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.

Newcomers AppGameKit Corner / CreateSprite not displaying image

Author
Message
bjj_bro
7
Years of Service
User Offline
Joined: 20th Sep 2016
Location:
Posted: 21st Sep 2016 17:18
Hello,

I am new to AppGameKit and am using it for my C++ class. I am knowledgeable in C++ but I am having some issues getting the AppGameKit CreateSprite to display my image in VS2015.

All I get is an "X" where the sprite should display. My theory is the application can't locate the image, but I don't know how to configure that?

My code is as follows:



BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 21st Sep 2016 18:08
By default, your image must be in the media subfolder.
The X is a default image when the desired image is not found.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
bjj_bro
7
Years of Service
User Offline
Joined: 20th Sep 2016
Location:
Posted: 21st Sep 2016 18:32
Do you know the directory where the "media" folder is located? I have attached a snapshot of my directory.

Attachments

Login to view attachments
bjj_bro
7
Years of Service
User Offline
Joined: 20th Sep 2016
Location:
Posted: 21st Sep 2016 20:29
My textbook says you can pass a filename string to the CreateSprite() function. However, this isn't the case anymore, per the errors I am getting.

Attachments

Login to view attachments
FM77
8
Years of Service
User Offline
Joined: 6th Oct 2015
Location:
Posted: 22nd Sep 2016 06:28
Copy your source media folder to your final build folder.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 22nd Sep 2016 13:05
The media folder is a subfolder of the folder where your executable is located.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt

Login to post a reply

Server time is: 2024-04-24 05:28:59
Your offset time is: 2024-04-24 05:28:59