mWidth
and mHeight
.
E.g. a window constructed with new CSWindow(200, 400)
has a height of 200 and a width of 400. This is space the window occupies on the screen (if not out of bounds).
(The following text refers to windows only, since windows are easy to understand, but the viewport concept holds true for ALL CSGraphikElements.)
The maximum size of the viewport of the window is at this moment also 200 x 400 (that doesn't imply, that all elements added to the window are size restricted to be smaller than 200 x 400 -> but that later).
The viewport of the window is the hole, thru that a spectator can watch the action that takes place behind the window. A real life example, take a window: a REAL window - out of glass. What makes up the window? Say you see it from two meters distant.
mViewportHeight
and mViewportHeight
. The viewport has an offset to the position of the window start (kept in mViewportX
and mViewportY
).Non viewported elements are usually autosizing (menubars stretch all the way, even if the size of the window changes). If they are not autosizing, it is assumed they don't influence the viewport size! ->
When adding a viewported element, the position of the element is in relation to the viewport start. That means you cannot position a viewported element on the window on a position that is not taken up by the viewport. The window thinks it belongs to the viewport and is actually displaying only parts of it if positioned out of bounds (like -> you don't see the whole sky if you look out of the real window, only part of it).
When adding elements to a window that are not viewported, they are in relation to the actual start position of the window.
All elements can either be viewported or non viewported. Befor they are added to another element, they must be set to either viewported or non viewported, using:
void setViewported(bool viewported)All elements have sensible default values!
Generated on Wed Jul 14 00:45:34 2004 for CSLib by1.3.6