def draw_idle_at(self, game: Game, unscaled_dst: SDL_Rect): # for when ui wants to draw as unit somewhere idle_src_0 = self.idle_down.at(0) unscaled_dst.w = idle_src_0.w unscaled_dst.h = idle_src_0.h set_scaled_rect(unscaled_dst, game.engine.scale) SDL_RenderCopy(game.engine.renderer, self.image.texture, idle_src_0, unscaled_dst)
def draw_at(self, game: Game, unscaled_dst: SDL_Rect): # for when ui wants to draw the sprite somewhere src = self.srcs.at(0) unscaled_dst.w = src.w unscaled_dst.h = src.h set_scaled_rect(unscaled_dst, game.engine.scale) SDL_RenderCopy(game.engine.renderer, self.image.texture, src, unscaled_dst)
def draw(self, game: Game): src = self.ability.sprite.srcs.at(self.current_frame_idx) SDL_RenderCopy(game.engine.renderer, self.ability.sprite.image.texture, src, self.render_dst.scaled_dst)
def render_system(game: Game, game_database: GameDatabase): for go in game_database.render_sprite_table: position = addr(game_database.c_positions[go.c_position_idx]) sprite = addr(game_database.c_sprites[go.c_sprite_idx]) SDL_RenderCopy(game.engine.renderer, sprite.src, position.dst)
def render_sprite_draw(game: Game, render_sprite: RenderSprite): SDL_RenderCopy(game.engine.renderer, render_sprite.texture, render_sprite.src, render_sprite.dst)
def draw(self, game: Game): SDL_RenderCopy(game.engine.renderer, self.image.texture, self.current_src, self.render_dst.scaled_dst)