battlespace

open fun battlespace(sprite: SpriteAPI, 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 in absolute engine coordinates for a duration. Simple declaration.

Parameters

sprite

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

loc

Vector2f, center in world coordinates.

vel

Vector2f() velocity of the sprite.

size

Vector2f(width, height) in pixels.

growth

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

angle

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

spin

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

color

Color() override, also used for fading.

additive

boolean for additive blending.

fadein

time in sec for fading in.

full

time in sec at maximum opacity (clamped by color)

fadeout

time in sec for fading out


open fun battlespace(sprite: SpriteAPI, 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 in absolute engine coordinates for a duration. Advanced declaration.

Parameters

sprite

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

loc

Vector2f, center in world coordinates.

vel

Vector2f() velocity of the sprite.

size

Vector2f(width, height) in pixels.

growth

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

angle

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

spin

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

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.

full

time in sec at maximum opacity (clamped by color)

fadeout

time in sec for fading out

layer

: layer to render at


open fun battlespace(sprite: SpriteAPI, 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 in absolute engine coordinates for a duration. Advanced declaration with OpenGL blending options

Parameters

sprite

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

loc

Vector2f, center in world coordinates.

vel

Vector2f() velocity of the sprite.

size

Vector2f(width, height) in pixels.

growth

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

angle

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

spin

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

color

Color() override, also used for fading.

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.

full

time in sec at maximum opacity (clamped by color)

fadeout

time in sec for fading out

layer

: layer to render at

srcBlendFunc

: openGL source blend function

destBlendFunc

: openGL destination blend function