VP
From IfsoGUIWiki
Contents |
ifsoGUI ViewPort
Type: ifsoGUI_VP
Module: ifsogui.gui
General
The ifsoGUI_VP type allows you to specify a viewport that gets more and more restrictive as more viewports are added to it. This way, as more gadgets are added, the drawing of the gadgets gets more restricted so gadgets are drawn within the bounds of their parents and borders. Normally, you would add a viewport to the stack when drawing and when you are finished with that viewport, you can pop it off the stack returning the viewport to what it was before you added a viewport.
You do not create an instance of ifsoGUI_VP, you just use its functions. Internally, it creates instances to save the states.
Note: ifsoGUI is not affected by any of the BlitzMax commands that affect drawing like rotation, scale, or origin changes.
Globals
These variables hold the current viewport dimensions. They can be useful if you wish to determine the current drawing limitations. See the Drawing Partial Characters section of the FontSystems page to see one use.
- vpX:Int - X position of the viewport.
- vpY:Int - Y position of the viewport.
- vpW:Int - Width of the veiwport.
- vpH:Int - Height of the viewport.
Functions
- Add(iX:Int, iY:Int, iW:Int, iH:Int) - Pushes a viewport onto the queue in add mode.
- DrawImageArea(image:TImage, x:Float, y:Float) - Draws an image restricted to the area of the viewport.
- DrawImageArea2(image:ifsoGUI_Image, x:Float, y:Float, imgIndex:Int) - Draws an image restricted to the area of the viewport.
- DrawImageAreaRect(image:TImage, x:Float, y:Float, w:Float, h:Float) - Draws an image stretched and restricted to the area of the viewport.
- DrawImageAreaRect2(image:ifsoGUI_Image, x:Float, y:Float, w:Float, h:Float, imgIndex:Int) - Draws an image stretched and restricted to the area of the viewport.
- DrawLine(x:Float, y:Float, x2:Float, y2:Float, LastPixel:Int = True) - Draws a line restricted to the area of the viewport.
- DrawRect(x:Float, y:Float, width:Float, height:Float) - Draws a rectangle restricted to the area of the view port.
- DrawTextArea(text:String, x:Float, y:Float) - Draws text restricted to the area of the viewport.
- Push() - Pushes a viewport onto the queue.
- Pop() - Pops a viewport off of the queue.
