A Display represents an rectangular area inside the PeoteView
what contains a Program
list for rendering.
All the inner content can be shifted and zoomed.
Constructor
new(x:Int, y:Int, width:Int, height:Int, color:Color = 0x00000000)
Creates a new Display
instance.
Parameters:
x | x-position of the upper left corner |
---|---|
y | y-position of the upper left corner |
width | horizontal size of the display |
height | vertical size of the display |
color | background color (by default the alpha value is fully transparent and so also no background is rendered) |
Variables
read onlyfbTexture:Texture = null
The texture to render the display content inside if using into framebuffer-mode.
renderFramebufferEnabled:Bool = true
Enable or disable texture-rendering if the display is inside the framebuffer chain.
renderFramebufferSkipFrames:Int = 0
If the display is inside the framebuffer chain, this defines how many frames are skipped before it renders into the texture again.
Methods
inlineisIn(peoteView:PeoteView):Bool
Returns true is this display is inside the RenderList of a PeoteView
instance.
Parameters:
peoteView | PeoteView instance |
---|
addToPeoteView(peoteView:PeoteView, ?atDisplay:Display, addBefore:Bool = false):Void
Adds this display to the RenderList of a PeoteView
instance.
Can be also used to change the order (relative to another display) if it is already added.
Parameters:
peoteView | PeoteView instance |
---|---|
atDisplay | (optional) to add or move before or after another display in the RenderList (by default at start or at end) |
addBefore | (optional) if 'true' it's added before another display or at start of the Renderlist (by default it's added after atDisplay or at end) |
removeFromPeoteView(peoteView:PeoteView):Void
Removes this display from the RenderList of a PeoteView
instance.
Parameters:
peoteView | PeoteView instance |
---|
addToPeoteViewFramebuffer(peoteView:PeoteView, ?atDisplay:Display, addBefore:Bool = false):Void
Adds this display to the hidden framebuffer RenderList (what only render to textures) of a PeoteView
instance.
Can be also used to change the order (relative to another display) if it is already added.
Parameters:
peoteView | PeoteView instance |
---|---|
atDisplay | (optional) to add or move before or after another display in the framebuffer RenderList (by default at start or at end) |
addBefore | (optional) if 'true' it's added before another display or at start of the framebuffer Renderlist (by default it's added after atDisplay or at end) |
removeFromPeoteViewFramebuffer(peoteView:PeoteView):Void
Removes this display from the hidden framebuffer RenderList (what only render to textures) of a peoteView.
Parameters:
peoteView | PeoteView instance |
---|
swapDisplay(display:Display):Void
Swaps the order of this Display instances with another one inside the RenderList.
Parameters:
display | Display instance |
---|
swapPrograms(program:Program, programToSwapWith:Program):Void
Swaps the order of two Program
s inside the RenderList.
Parameters:
program | Program instance |
---|---|
programToSwapWith | Program instance to swap with |
inlinehasProgram(program:Program):Bool
Returns true if the program is added to the RenderList already.
Parameters:
program | Program instance |
---|
addProgram(program:Program, ?atProgram:Program, addBefore:Bool = false):Void
Adds a Program
instance to the RenderList of this Display.
Can be also used to change the order relative to another program if it's already added.
Parameters:
program | Program instance to add into the RenderList or to change it's order |
---|---|
atProgram | (optional) to add or move the program before or after another program in the Renderlist (by default it's added at start or end) |
addBefore | (optional) if 'true' it's added before another program or at start of the Renderlist (by default it's added after atProgram or at end of the list) |
removeProgram(program:Program):Void
setFramebuffer(texture:Texture, ?textureSlot:Int, ?peoteView:PeoteView):Void
Set a Texture
instance to use as a framebuffer for renderToTexture()
Parameters:
texture | Texture instance to render into |
---|---|
textureSlot | number of texture-slot to render into (can be changed by set the 'framebufferTextureSlot' property) |
peoteView | optional parameter that is need if the display not already added to a RenderList |
inlineisPointInside(px:Int, py:Int, ?peoteView:PeoteView):Bool
Gives true if a point at global screenposition px and py is inside the Display-area.
Parameters:
px | global x-position |
---|---|
py | global y-position |
peoteView | (optional) if not already added to a peoteView you can set one here to include it's zoom and offset into calculation |
inlineglobalX(localX:Float, ?peoteView:PeoteView):Float
Converts a local x-position from display-coordinates to the correspondending global screen ones.
Parameters:
localX | x-position inside of the display |
---|---|
peoteView | (optional) if not already added to a peoteView you can set one here to include it's zoom and offset into calculation |
inlinelocalX(globalX:Float, ?peoteView:PeoteView):Float
Converts a global x-position from screen-coordinates to the correspondending local display ones.
Parameters:
globalX | x-position at screen |
---|---|
peoteView | (optional) if not already added to a peoteView you can set one here to include it's zoom and offset into calculation |
inlineglobalY(localY:Float, ?peoteView:PeoteView):Float
Converts a local y-position from display-coordinates to the correspondending global screen ones.
Parameters:
localY | y-position inside of the display |
---|---|
peoteView | (optional) if not already added to a peoteView you can set one here to include it's zoom and offset into calculation |
inlinelocalY(globalY:Float, ?peoteView:PeoteView):Float
Converts a global y-position from screen-coordinates to the correspondending local display ones.
Parameters:
globalY | y-position at screen |
---|---|
peoteView | (optional) if not already added to a peoteView you can set one here to include it's zoom and offset into calculation |
inlinerenderToTexture(peoteView:PeoteView, ?textureSlot:Int):Void
Renders the content of this Display into a texture.
Parameters:
peoteView | PeoteView instance |
---|---|
slot | (0 by default) the image-slot inside of the texture (if the framebuffer texture can contain more then one) |