Magic Render
Draw arbitrary sprites on screen with constraints to entities/camera when needed. Most drawing functions come with three optional declarations: A simple declaration that should cover most use cases, an advanced declaration that adds jitter/flicker controls plus render layer overrides, and an advanced declaration that also includes OpenGL blending options. Note that every element will be drawn one frame late.
Author
Tartiflette
Types
Link copied to clipboard
enum positioning
Functions
Link copied to clipboard
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)
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)
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.
Link copied to clipboard
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)
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)
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.
Link copied to clipboard
Checks if a point is within a certain distance of the screen's edges; Used to avoid spawning particles or other effects that won't be seen by the player while impacting performances.
Link copied to clipboard
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)
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)
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.
Link copied to clipboard
open fun singleframe(sprite: SpriteAPI, loc: Vector2f, size: Vector2f, angle: Float, color: Color, additive: Boolean)
Single frame render in absolute engine coordinates, can be used for animations.
open fun singleframe(sprite: SpriteAPI, loc: Vector2f, size: Vector2f, angle: Float, color: Color, additive: Boolean, layer: CombatEngineLayers)
Single frame render, absolute engine coordinates, can be used for animations.
open fun singleframe(sprite: SpriteAPI, loc: Vector2f, size: Vector2f, angle: Float, color: Color, layer: CombatEngineLayers, srcBlendFunc: Int, destBlendFunc: Int)
Single frame render in absolute engine coordinates with OpenGL blending options, can be used for animations.