Creating a scene
You need to make a scene to place your objects in. The syntax of the game object function is: setupScene(id,r,c); r is the rect, which defines the shape of your scene. c is the background color of your scene. Note that if you do not specify c, the scene will have no background color. Also, specifying a semi-transparent background (or an invisible one!) will cause all your objects to become semi-transparent (or invisible) also! It is far better to specify no background and then create a great big rectangle with a semi-transparent color.
id is the css id of the scene you want to specify. Ensure that there are no conflicts with your pre-existing style sheet(s). Bear in mind also that a page can have only one scene. This function returns the id-reference to the scene. If you wish to move the scene etc, use the return value's style property.

Help with positioning your scene
The rect ldk_fullscreen is the size of your visitor's screen, as it was when the LDK library was declared and loaded. ldk_screenCentre is a 1X1 pixel at the centre of the screen. ldk_middleX is the centre x-coordinate of the screen, whilst ldk_middleY is the centre y-coordinate.

Last edited Dec 13, 2009 at 11:02 PM by larztheloser, version 3


No comments yet.