SpriteAtlas.cpp
SpriteAtlas.cpp
CPP1/* Copyright Statement:2 *3 * (C) 2021-2024 Cubios Inc. All rights reserved.4 */56#include "SpriteAtlas.h"78namespace Cubios9{10 namespace Gfx11 {12 SpriteAtlasElement::SpriteAtlasElement(SpriteAtlasBase* host, const Cubios::Math::Rect2& rc):host(host),rc(rc)13 {14 }1516 SpriteAtlasElement::~SpriteAtlasElement()17 {18 }1920 void SpriteAtlasElement::Render()21 {22 Math::Vec2 pos = this->ScreenPosition();23 Cubios::GFX_drawSubImage(this->host->resourceId, pos.X,pos.Y,24 this->rc.v0.X,this->rc.v0.Y,this->rc.W,this->rc.H,25 Color.A(),26 Color.Value(),27 Transform.ScaleX, Transform.ScaleY,28 Transform.SafeRotation()+ScreenAngle, Transform.Mirroring);29 }3031 SpriteAtlasElement* SpriteAtlasElement::Copy()32 {33 SpriteAtlasElement* obj = new SpriteAtlasElement(this->host, this->rc);3435 obj->Transform = this->Transform;36 obj->Color = this->Color;3738 return obj;39 }40 }41}42
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.