explanations needed about "Window parameter"

Started by Joulz, May 14, 2011, 03:40:28 AM

Previous topic - Next topic

Joulz

alright, so i've been trying to understand how this works:

Quote;This defines the drawing space, or "window" of the background. It's
;given in the form
;x1,y1, x2,y2
;where (x1,y1)-(x2,y2) define a rectangular box.
;Make the window smaller if you only want to draw part of the background.
;You normally do not have to change this setting. Value values range from
;0-319 for x, and 0-239 for y. The values are 0,0, 319,239 by default (full
;screen).
;Uncomment the line below to use it:
;window = 0,0, 319, 239

after some tries, i can't seem to wrap my head around this one... anyone care to explain (eventually with screenshots if possible)

thanks

Joulz


tunglashor

What specifically are you having trouble with?  What it does or how to use it?
It's for restricting the area on the screen where the element will be shown - only the parts of the element that intersect with the window will be drawn.  For example, say you have a sprite that fills the whole screen but specify a window of 10,10, 309, 229 then you'll get a border of ten pixels around the edges of the screen where the sprite won't be visible.

Does that help at all?

Joulz

#3
mmmh it actually does... 
but let me give you an example to actually have a picture of it: let's say i have a sprite i only want to be drawn in a square of 416 x 450.. how would that work?

also, does the window parameter work with animations or just single sprite??