Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Anthracis

Member Since 22 Jan 2008
Offline Last Active Jul 23 2014 02:07 AM

#4998367 Help appreciated with CSS/HTML layout issue

Posted by Anthracis on 07 November 2012 - 06:57 AM

Yes you are absolutely right.
I did not pay attention to the background color, else I should have seen that.

I forgot to set the right coordinate of the content div to 0px.
so the complete version should be :

<!DOCTYPE html>
    <head>
	    <meta charset='UTF-8' />	 
	    <title>Test</title>
	    <style type="text/css">
	    html, body {
		    margin: 0;
		    padding: 0;
		    height: 100%;
		    width: 100%;
	    }
	    #navbar {
		    width: 100%;
		    height: 30px;
		    background-color: yellow;
		    display: inline;
		    top: 0;
		    left: 0;
		    position: absolute;
	    }
	    #wrapper {
		    background-color: red;
		    width: 100%;
		    height: 100%;
	    }
	    #main-wrapper {
		    background-color: blue;
		    width: 100%;
		    height: 100%;
	    }
	    #sidebar {
		    background-color: orange;
		    width: 32px;
		    left:0px;
		    display:inline;
		    position:absolute;
		    top:30px;
		    bottom:0px;
	    }
	    #content {
		    background-color: green;
		    left: 32px;
		    position:absolute;
		    top:30px;
		    bottom:0px;
	 right:0px;
	    }
	    .clear { clear: both;}
	    </style>
    </head>
	
    <body>
	    <div id="wrapper">
		    <div id="navbar"></div>
		    <div class="clear"></div>
		    <div id="sidebar"></div>
		    <div id="content"></div>
	    </div>
    </body>
</html>

at least that works for me now.


#4989076 Return class and method of a delegate

Posted by Anthracis on 11 October 2012 - 06:33 AM

Hi,

the delegate type provides you with all the necessary information. Especially the "Method"-property is helpful for your need.
Its "DeclaringType" gives you the type where your delegate function is defined and with the "Name"-Property you receive the name of the actual method.

So your two methods could look like this:

[source lang="csharp"] public static EaseCategory GetEaseCategory(EaseDelegate easeFunction) { if (easeFunction.Method.DeclaringType == typeof(Linear)) return EaseCategory.Linear; else if (easeFunction.Method.DeclaringType == typeof(Quadratic)) return EaseCategory.Quadratic; return EaseCategory.Sine; } public static EaseType GetEaseType(EaseDelegate easeFunction) { if (easeFunction.Method.Name == "EaseIn") return EaseType.EaseIn; else if (easeFunction.Method.Name == "EaseOut") return EaseType.EaseOut; return EaseType.EaseNone; } [/source]

Hope this helps with your problem.


#4981636 C# List<T>.Find

Posted by Anthracis on 19 September 2012 - 05:18 AM

Now, someone with more knowledge of building xna projects for xbox could probably correct me here, but I noticed the Xenon project uses .NET v2.0. So while the xna assemblies are version 4, the rest of the .net assemblies are version 2.0, and in that version, the List<> doesn't have a the Find() function. That's Probably because the xbox 360 doesn't support anything higher than that version. So if you want the game to work on xbox, you will have to write the game using stuff that exists in .net 2.0 and below only. Someone please correct me if I'm wrong Posted Image

As a side note: it is interesting that linq works there, since it was introduced in .net 3.5 iirc, but looking at the assembly version says its also 2.0... and reading up a bit it seems like xbox supports it.


.net-Framework versions 2.0 to 3.5 use the runtime version 2.0.
Features like Linq are only framework additions that are compiled to byte code running on a 2.0 runtime.

With Frameword version 4.0 a new runtime was introduced.
So assuming that the XBox uses a 2.0 runtime all features available up to Framework 3.5 should be available.

Edit: reformulated the post


PARTNERS