Here's how I used it
cSprite* mySprite;
cImage* myImage;
float _angle = 0;
void app::Begin( void )
{
agk::SetVirtualResolution(640,960);
agk::SetClearColor(0,0,0);
//load a 256 x 256 image
myImage = new cImage("stuff.png");
//create a sprite
mySprite = new cSprite(myImage);
//center pivot
mySprite->SetOffset(128,128);
//position in center of screen
mySprite->SetPositionByOffset(640/2,960/2);
}
// Main loop, called every frame
void app::Loop ( void )
{
//rotate by 5 randians each frame
_angle += 5 * agk::GetFrameTime();
while(_angle >= 360)
{
_angle-=360;
}
mySprite-> SetAngleRad(_angle);
//draw it and you should consider Update() , UpdateAnimation() , UpdatePhysics() when used
mySprite->Draw();
//draw screen
agk::Sync();
}
// Called when the app ends
void app::End ( void )
{
//dont forget to delete them from memory!
delete myImage;
delete mySprite;
}
And by the way, I still don't understand how LoadImage works!! I mean how to store media and call it from folders.
In tier one I spent ages to discover that I should put my files inside "Media" folder and to call something like:
"Media\sprite\mySprite.png"
I use LoadImage("sprite/mySprite.png")
while in C++ I should copy it to the Final folder or it'll never get loaded
And didn't find anything about that in the docs.
I'm back