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

@:value({ color : 0x00000000 })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 onlypeoteView:PeoteView

The PeoteView instance in which the display is contained.

x:Int

Horizontal position in pixels (distance to left edge of the view).

y:Int

Vertical position in pixels (distance to upper edge of the view).

width:Int

Horizontal size in pixels.

height:Int

Vertical size in pixels.

@:value(0x00000000)color:Color = 0x00000000

Background color.

@:value(false)backgroundAlpha:Bool = false

Background use transparency.

@:value(false)backgroundDepth:Bool = false

Background use depth value.

@:value(false)backgroundEnabled:Bool = false

To turn the background rendering on/off.

@:value(0)xOffset:Float = 0

To shift the render content horizontal.

@:value(0)yOffset:Float = 0

To shift the render content vertical.

@:value(1.0)read onlyxz:Float = 1.0

Total horizontal zoom factor, calculated by zoom * xZoom.

@:value(1.0)read onlyyz:Float = 1.0

Total vertical zoom factor, calculated by zoom * yZoom.

@:value(1.0)zoom:Float = 1.0

To zoom the render content (value > 1.0 to expand and < 1.0 to shrink).

@:value(1.0)xZoom:Float = 1.0

Multiplicator for horizontal zoom.

@:value(1.0)yZoom:Float = 1.0

Multiplicator for vertical zoom.

@:value(true)isVisible:Bool = true

Shows or hides the display during rendering.

@:value(0)framebufferTextureSlot:Int = 0

The texture-slot where to render into by renderToTexture().

@:value(true)renderFramebufferEnabled:Bool = true

Enable or disable texture-rendering if the display is inside the framebuffer chain.

@:value(0)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

show():Void

Shows the display during rendering.

hide():Void

Hides the display during rendering.

inlineisIn(peoteView:PeoteView):Bool

Returns true is this display is inside the RenderList of a PeoteView instance.

Parameters:

peoteView

PeoteView instance

@:value({ addBefore : false })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

@:value({ addBefore : false })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 Programs 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

@:value({ addBefore : false })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

Removes a Program instance from the RenderList.

Parameters:

program

Program instance

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

removeFramebuffer():Void

Clears the framebuffer for renderToTexture()

@:value({ peoteView : null })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

@:value({ peoteView : null })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

@:value({ peoteView : null })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

@:value({ peoteView : null })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

@:value({ peoteView : null })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)