1. 27 Dec, 2020 1 commit
    • Rahix's avatar
      sprite: Add custom offsetting mechanism · c12ef4fe
      Rahix authored
      In case some entity needs its sprite to be offset from its position, add
      an `offset` attribute to the `Sprite` component which allows doing just
      that.
      
      The offset is a translation vector from the default position.  By
      default, a sprite is placed such that its center is located at the
      entities `Position`.
      c12ef4fe
  2. 26 Dec, 2020 1 commit
    • Rahix's avatar
      sprites: Don't hold center coordinates in component · ff31586d
      Rahix authored
      Query the size of the sprite on the fly during rendering.  This makes
      component instanciation much easier because it no longer requires access
      to the `Rendering` API.
      
      As a later optimization, we could move this ofsetting into the
      draw_image() function via a new parameter.
      ff31586d
  3. 22 Dec, 2020 3 commits
    • Simon Goller's avatar
      Cargo fmt · 48d6a677
      Simon Goller authored
      48d6a677
    • Simon Goller's avatar
      Use sprite enum · d828d38d
      Simon Goller authored
      Sprites are now stored in sprites.rs in the Sprite enum.  This
      can be used to generate ImageHandles to generate Sprite
      entities.
      d828d38d
    • Simon Goller's avatar
      Integrate sprite loading · d663c95c
      Simon Goller authored
      Sprites are loaded during loading state and are passed to the
      ingame state.
      d663c95c