Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Windows / [Tier 2] agk:: Image Handling in Classes?

Author
Message
SimpleWalrus
1
Years of Service
User Offline
Joined: 21st Jan 2017
Location:
Posted: 21st Jan 2017 02:55
Hello, I recently purchased AppGameKit and had a blast with Tier 1. Now I am ready to take the libraries to C++, but I run into a issue.

Using the provided template for Visual Studio, I tried under app:Loop (void){
agk::LoadImage(1, "x.png");
agk::CreateSprite(1);
And put a x.png in my "Final" folder.

It worked properly (the image loaded). Please ignore the fact that there is no check if the sprite exists, I am aware to do this for an actual game/product. For the purposes of the demo, it does not matter.

However,
I made a class:
"Player.h"

Instead, I get a small white block in the corner of the window, no image.
What is causing this? I am misunderstanding the use of agk in Objects?
RobbSnow
2
Years of Service
User Offline
Joined: 14th Oct 2015
Location:
Posted: 8th Mar 2017 15:34
In your Final folder, make a folder called "media" and put your sprite images there. You should consider the "media" folder as the root of your application's filesystem access. Out of the box, this will be where your application reads files. Read the File section of the AppGameKit Commands page for information on how to change this location and learn where your files are written to.

Login to post a reply

Server time is: 2018-08-15 12:20:15
Your offset time is: 2018-08-15 12:20:15