objectspace

open fun objectspace(sprite: SpriteAPI, anchor: CombatEntityAPI, offset: Vector2f, vel: Vector2f, size: Vector2f, growth: Vector2f, angle: Float, spin: Float, parent: Boolean, color: Color, additive: Boolean, fadein: Float, full: Float, fadeout: Float, fadeOnDeath: Boolean)

Draws a sprite attached to an entity for a duration. Simple declaration.

Parameters

sprite

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

anchor

CombatEntityAPI the sprite will follow.

offset

Vector2f, offset from the anchor's center in world coordinates. If "parent" is true, it will be kept relative to the anchor's orientation.

vel

Vector2f() velocity of the sprite relative to the anchor. If "parent" is true, it will be relative to the anchor's orientation.

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 front. If "parent" is true, 0 will match the anchor's orientation.

spin

float of the sprite's rotation, in degree/sec. If "parent" is true, it will be relative to the anchor's orientation.

parent

boolean, if true the sprite will also follow the anchor's orientation in addition to the position.

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). If attached to a projectile that value can be longer than the maximum flight time, for example 99s.

fadeout

time in sec for fading out. If attached to a projectile, the sprite will immediately start to fade if the anchor hit or fade.

fadeOnDeath

if true the sprite will fadeout in case the anchor is removed, if false it will be instantly removed. Mostly useful if you want to put effects on missiles or projectiles.


open fun objectspace(sprite: SpriteAPI, anchor: CombatEntityAPI, offset: Vector2f, vel: Vector2f, size: Vector2f, growth: Vector2f, angle: Float, spin: Float, parent: Boolean, color: Color, additive: Boolean, jitterRange: Float, jitterTilt: Float, flickerRange: Float, flickerMedian: Float, maxDelay: Float, fadein: Float, full: Float, fadeout: Float, fadeOnDeath: Boolean, layer: CombatEngineLayers)

Draws a sprite attached to an entity for a duration. Advanced declaration.

Parameters

sprite

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

anchor

CombatEntityAPI the sprite will follow.

offset

Vector2f, offset from the anchor's center in world coordinates. If "parent" is true, it will be kept relative to the anchor's orientation.

vel

Vector2f() velocity of the sprite relative to the anchor. If "parent" is true, it will be relative to the anchor's orientation.

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 front. If "parent" is true, 0 will match the anchor's orientation.

spin

float of the sprite's rotation, in degree/sec. If "parent" is true, it will be relative to the anchor's orientation.

parent

boolean, if true the sprite will also follow the anchor's orientation in addition to the position.

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). If attached to a projectile that value can be longer than the maximum flight time, for example 99s.

fadeout

time in sec for fading out. If attached to a projectile, the sprite will immediately start to fade if the anchor hit or fade.

fadeOnDeath

if true the sprite will fadeout in case the anchor is removed, if false it will be instantly removed. Mostly useful if you want to put effects on missiles or projectiles.

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

layer

layer to render at


open fun objectspace(sprite: SpriteAPI, anchor: CombatEntityAPI, offset: Vector2f, vel: Vector2f, size: Vector2f, growth: Vector2f, angle: Float, spin: Float, parent: Boolean, color: Color, jitterRange: Float, jitterTilt: Float, flickerRange: Float, flickerMedian: Float, maxDelay: Float, fadein: Float, full: Float, fadeout: Float, fadeOnDeath: Boolean, layer: CombatEngineLayers, srcBlendFunc: Int, destBlendFunc: Int)

Draws a sprite attached to an entity for a duration. Advanced declaration with OpenGl blending options.

Parameters

sprite

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

anchor

CombatEntityAPI the sprite will follow.

offset

Vector2f, offset from the anchor's center in world coordinates. If "parent" is true, it will be kept relative to the anchor's orientation.

vel

Vector2f() velocity of the sprite relative to the anchor. If "parent" is true, it will be relative to the anchor's orientation.

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 front. If "parent" is true, 0 will match the anchor's orientation.

spin

float of the sprite's rotation, in degree/sec. If "parent" is true, it will be relative to the anchor's orientation.

parent

boolean, if true the sprite will also follow the anchor's orientation in addition to the position.

color

Color() override, also used for fading.

fadein

time in sec for fading in.

full

time in sec at maximum opacity (clamped by color). If attached to a projectile that value can be longer than the maximum flight time, for example 99s.

fadeout

time in sec for fading out. If attached to a projectile, the sprite will immediately start to fade if the anchor hit or fade.

fadeOnDeath

if true the sprite will fadeout in case the anchor is removed, if false it will be instantly removed. Mostly useful if you want to put effects on missiles or projectiles.

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

layer

layer to render at

srcBlendFunc

openGL source blend function

destBlendFunc

openGL destination blend function