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.

AppGameKit Classic Chat / LoadSubImage c++

Author
Message
fhalo
12
Years of Service
User Offline
Joined: 10th Jun 2012
Location:
Posted: 6th Apr 2015 19:47
Hii


Trying to get this to work under C++

batchNode = agk::LoadImage("Atlas.png");
ship = agk::LoadSubImage(batchNode,"ship.png");
sprite = agk::CreateSprite(ship);

It will not display the ship.

Have already created subimges.txt file using Texturepacking software.


Any suggestions?
3d point in space
15
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 7th Apr 2015 04:03 Edited at: 7th Apr 2015 04:03
do you have an Atlas subimages file in the same directory. Another question to ask is if Altas loads or not:

it has to be Atlas subimages with a capital A also.

Developer of Space Chips, pianobasic, zipzapzoom, and vet pinball apps. Developed the tiled map engine seen on the showcase. Veteran for the military.
fhalo
12
Years of Service
User Offline
Joined: 10th Jun 2012
Location:
Posted: 7th Apr 2015 10:47
Hi

Thanks for the reply.

I'm bit confused.

Atlas.png contains all images.

I tested that it can load and display the png file using

sprite = agk::CreateSprite(batchNode); So thats works.

In the same folder. I have Atlas.png & Atlas.txt.

ship = agk::LoadSubImage(batchNode,"ship.png"); This fails to load/display the ship image from the Atlas.png.

Is they a working example using LoadSubImage in c++?


Thanks.
fhalo
12
Years of Service
User Offline
Joined: 10th Jun 2012
Location:
Posted: 7th Apr 2015 20:33
Hi

Thanks for the reply.

I\'m bit confused.

Atlas.png contains all images.

I tested that it can load and display the png file using

sprite = agk::CreateSprite(batchNode); So thats works.

In the same folder. I have Atlas.png & Atlas.txt.

ship = agk::LoadSubImage(batchNode,\"ship.png\"); This fails to load/display the ship image from the Atlas.png.

Is they a working example using LoadSubImage in c++?


Thanks.
fhalo
12
Years of Service
User Offline
Joined: 10th Jun 2012
Location:
Posted: 7th Apr 2015 20:35
SOLVED:

This youtube is very usefule

https://www.youtube.com/watch?v=6swLL7aMalY

Problem, need white space in the *.txt title

eg "Atlas subimages.txt"


Thanks again

Login to post a reply

Server time is: 2024-11-25 20:38:20
Your offset time is: 2024-11-25 20:38:20