screenspace

open fun screenspace(sprite: SpriteAPI, pos: MagicRender.positioning, loc: Vector2f, vel: Vector2f, size: Vector2f, growth: Vector2f, angle: Float, spin: Float, color: Color, additive: Boolean, fadein: Float, full: Float, fadeout: Float)

Draws a sprite attached to the camera for a duration. Simple declaration.

Parameters

sprite

SpriteAPI to render. Use Global.getSettings().getSprite(settings category, settings id)

pos

Positioning mode, set the point of reference, useful for UI elements. use MagicRender.positioning STRETCH_TO_FULLSCREEN will override the size, FULLSCREEN_MAINTAIN_RATIO will use the size as a ratio reference and then scale the sprite accordingly.

loc

Vector2f, center in world coordinates. Ignore for fullscreen.

vel

Vector2f() velocity of the sprite. Ignore for fullscreen.

size

Vector2f(width, height) in pixels. size reference for FULLSCREEN_MAINTAIN_RATIO, ignore for STRETCH_TO_FULLSCREEN.

growth

Vector2f() change of size over time in pixels/sec. Can be negative, a sprite that completely shrunk will be removed. Ignore for fullscreen.

angle

float of the sprite's azimuth. 0 is pointing top. Ignore for fullscreen.

spin

float of the sprite's rotation, in degree/sec. Ignore for fullscreen.

color

Color() override, also used for fading.

additive

boolean for additive blending.

fadein

time in sec for fading in. Set to -1 for single frame render.

full

time in sec at maximum opacity (clamped by color). Set to -1 for single frame render.

fadeout

time in sec for fading out. Set to -1 for single frame render.


open fun screenspace(sprite: SpriteAPI, pos: MagicRender.positioning, loc: Vector2f, vel: Vector2f, size: Vector2f, growth: Vector2f, angle: Float, spin: Float, color: Color, additive: Boolean, jitterRange: Float, jitterTilt: Float, flickerRange: Float, flickerMedian: Float, maxDelay: Float, fadein: Float, full: Float, fadeout: Float, layer: CombatEngineLayers)

Draws a sprite attached to the camera for a duration. Advanced declaration.

Parameters

sprite

SpriteAPI to render. Use Global.getSettings().getSprite(settings category, settings id)

pos

Positioning mode, set the point of reference, useful for UI elements. use MagicRender.positioning STRETCH_TO_FULLSCREEN will override the size, FULLSCREEN_MAINTAIN_RATIO will use the size as a ratio reference and then scale the sprite accordingly.

loc

Vector2f, center in world coordinates. Ignore for fullscreen.

vel

Vector2f() velocity of the sprite. Ignore for fullscreen.

size

Vector2f(width, height) in pixels. size reference for FULLSCREEN_MAINTAIN_RATIO, ignore for STRETCH_TO_FULLSCREEN.

growth

Vector2f() change of size over time in pixels/sec. Can be negative, a sprite that completely shrunk will be removed. Ignore for fullscreen.

angle

float of the sprite's azimuth. 0 is pointing top. Ignore for fullscreen.

spin

float of the sprite's rotation, in degree/sec. Ignore for fullscreen.

color

Color() override, also used for fading.

additive

boolean for additive blending.

jitterRange

max jitter offset from base position

jitterTilt

max jitter rotation from base position

flickerRange

max flickering range, can be >1 to maintain the sprite on or off

flickerMedian

default opacity before flickering, can be >or <0

maxDelay

base frequency is 60 update per second, delay can be randomly increased to this value

fadein

time in sec for fading in. Set to -1 for single frame render.

full

time in sec at maximum opacity (clamped by color). Set to -1 for single frame render.

fadeout

time in sec for fading out. Set to -1 for single frame render.

layer

layer to render at


open fun screenspace(sprite: SpriteAPI, pos: MagicRender.positioning, loc: Vector2f, vel: Vector2f, size: Vector2f, growth: Vector2f, angle: Float, spin: Float, color: Color, jitterRange: Float, jitterTilt: Float, flickerRange: Float, flickerMedian: Float, maxDelay: Float, fadein: Float, full: Float, fadeout: Float, layer: CombatEngineLayers, srcBlendFunc: Int, destBlendFunc: Int)

Draws a sprite attached to the camera for a duration. Advanced declaration with OpenGl blending options.

Parameters

sprite

SpriteAPI to render. Use Global.getSettings().getSprite(settings category, settings id)

pos

Positioning mode, set the point of reference, useful for UI elements. use MagicRender.positioning STRETCH_TO_FULLSCREEN will override the size, FULLSCREEN_MAINTAIN_RATIO will use the size as a ratio reference and then scale the sprite accordingly.

loc

Vector2f, center in world coordinates. Ignore for fullscreen.

vel

Vector2f() velocity of the sprite. Ignore for fullscreen.

size

Vector2f(width, height) in pixels. size reference for FULLSCREEN_MAINTAIN_RATIO, ignore for STRETCH_TO_FULLSCREEN.

growth

Vector2f() change of size over time in pixels/sec. Can be negative, a sprite that completely shrunk will be removed. Ignore for fullscreen.

angle

float of the sprite's azimuth. 0 is pointing top. Ignore for fullscreen.

spin

float of the sprite's rotation, in degree/sec. Ignore for fullscreen.

color

Color() override, also used for fading.

fadein

time in sec for fading in. Set to -1 for single frame render.

full

time in sec at maximum opacity (clamped by color). Set to -1 for single frame render.

fadeout

time in sec for fading out. Set to -1 for single frame render.

layer

layer to render at

jitterRange

max jitter offset from base position

jitterTilt

max jitter rotation from base position

flickerRange

max flickering range, can be >1 to maintain the sprite on or off

flickerMedian

default opacity before flickering, can be >or <0

maxDelay

base frequency is 60 update per second, delay can be randomly increased to this value

srcBlendFunc

openGL source blend function

destBlendFunc

openGL destination blend function