Background
is the area where every sprites lived. A background has a view area/view port/clipping area, that is the area which is seen to the player. By default the view area of a newly created background is as big as game dimension. For example if the game is created as big as 640 x 480 dimension, the background view area would be also 640 x 480, thus occupy all the game view. To set the background view area, use {@linkplain #setClip(int,int,int,int) setClip(x, y, width, height)}.
If the background size is larger than view area, means there is area not viewable, use {@linkplain #move(double,double) move(dx, dy)} or{@linkplain #setLocation(double,double)} to move around.
To set a sprite to be the center of the background, use {@linkplain #setToCenter(Sprite)}. @see com.golden.gamedev.object.background
|
|
|
|