PeoteView represents the main "view" that must be called in a Lime application at startup to initialize the OpenGL-context and the onRender
and onResize
events.
It contains a list of Display
areas and the entire view can be moved and zoomed.
Constructor
Variables
read onlyisRun:Bool = false
Returns true
if the time
is started (for @anim
tagged attributes into Elements).
Methods
inlinehasDisplay(display:Display):Bool
Returns true if the Display
instance is added to the RenderList already.
Parameters:
display | Display instance |
---|
addDisplay(display:Display, ?atDisplay:Display, addBefore:Bool = false):Void
Adds a Display
instance to the RenderList.
Can be also used to change the order (relative to another display) if it's already added.
Parameters:
display | Display instance to add into the RenderList or to change it's order |
---|---|
atDisplay | (optional) to add or move the display before or after another display in the Renderlist (by default it adds at start or end) |
addBefore | (optional) set to |
removeDisplay(display:Display):Void
swapDisplays(display1:Display, display2:Display):Void
Swaps the order of two Display
instances inside the RenderList.
Parameters:
display1 | first display instance |
---|---|
display2 | second display instance |
addFramebufferDisplay(display:Display, ?atDisplay:Display, addBefore:Bool = false):Void
Adds an Display
instance to the hidden framebuffer RenderList (what only render to textures).
Can be also used to change the order (relative to another display) if it's already added.
Parameters:
display | Display instance to add into the RenderList or to change it's order |
---|---|
atDisplay | (optional) to add or move the display before or after another display in the Renderlist (by default it adds at start or end) |
addBefore | (optional) set to |
removeFramebufferDisplay(display:Display):Void
Removes a Display
instance from the hidden framebuffer RenderList (what only render to textures).
Parameters:
display | Display instance |
---|
setNewGLContext(newGl:PeoteGL):Void
Changes the gl-context of the View and all contained Displays (only need if using multiple Lime windows).
Parameters:
newGl | new OpenGL context |
---|
resize(width:Int, height:Int):Void
This function is need to call if the window-size is changed (automatically by registerEvents
parameter into constructor)
Parameters:
width | new window width |
---|---|
height | new window height |
inlineglobalX(localX:Float):Float
Converts a local x-position from view-coordinates to the correspondending global screen ones.
Parameters:
localX | x-position inside of the view |
---|
inlinelocalX(globalX:Float):Float
Converts a global x-position from screen-coordinates to the correspondending local view ones.
Parameters:
globalX | x-position at screen |
---|
inlineglobalY(localY:Float):Float
Converts a local y-position from view-coordinates to the correspondending global screen ones.
Parameters:
localY | y-position inside of the view |
---|
inlinelocalY(globalY:Float):Float
Converts a global y-position from screen-coordinates to the correspondending local view ones.
Parameters:
globalY | y-position at screen |
---|
getElementAt(posX:Float, posY:Float, display:Display, program:Program):Int
getAllElementsAt(posX:Float, posY:Float, display:Display, program:Program):Array<Int>
setFramebuffer(display:Display, texture:Texture, ?textureSlot:Int):Void
renderToTexture(display:Display, ?textureSlot:Int):Void
Renders the content of a display into a texture.
Parameters:
display | the |
---|---|
textureSlot | number of texture-slot to render into (can be changed by set the |
render(?context:RenderContext):Void
To render a single Frame. This can be called manually inside Lime's onRender
-eventhandler if the parameter registerEvents
is false during instancing.
Can be also used to render only a single FramebufferDisplay.
Parameters:
context | limes OpenGL RenderContext instance |
---|
inlinerenderPart():Void
To render a single Frame without clearing the OpenGL viewport (e.g. to use it inside other frameworks).