Render Components
Source file: client/include/components/RenderComponent.hpp
Purpose: Enumerate the SFML render components: sprites, shaders, animated sprites, text, and particles.
Drawable
- Sprite path
spritePath(prefixed withassets/images/), layeringz_index,opacity,rotation, and tintcolor. - Owns SFML resources (
texture,sprite) withisLoadedto avoid redundant loads. - Non-copyable; move operations rebind the sprite to the moved texture to keep visuals intact.
Shader
- Fragment shader description:
shaderPath(prefixedassets/shaders/), shared pointershader,uniforms_float, andisLoadedflag. InitializeShaderSystembindstexturetosf::Shader::CurrentTextureand uploads provided uniforms.
AnimatedSprite
- Animation map (
animationsname →Animation), current animation keycurrentAnimation, optionalanimationQueuefor temporary overrides. - Playback state:
animated,elapsedTime. Animationholds spritesheet path (prefixed), frame dimensions,totalFrames,current_frame,frameDuration,loop,first_frame_position,offset, plus SFMLtexture/spriteandisLoaded.- Main API:
AddAnimation,SetCurrentAnimation,GetCurrentAnimation(const and non-const) used by animation/render systems.
Text
- Text content
content, font pathfontPath(prefixedassets/fonts/),characterSize,color,opacity,z_index, localoffset. - SFML resources:
sf::Text text,sf::Font font,is_loadedguard. Non-copyable; move rebinds the text to the moved font to avoid dangling pointers.
ParticleEmitter / Particle
Particle: position, velocity, remaininglifetimeandmaxLifetimesnapshot.ParticleEmitter: emission toggles (active,emitting), optional duration, containerparticles(capped bymaxParticles),emissionRateand accumulator, color gradient (startColor,endColor), spawnoffset, physical params (lifetime, speed, basedirection,spreadAngle,gravity,emissionRadius), size interpolation (start_size,end_size), renderz_index, andvertices(point list) for drawing.- Intended to be consumed by a particle system to spawn, update, and render GPU-friendly points.