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.

iOS and MacOS / Tier2 mac template and media files

Author
Message
RGBZ
6
Years of Service
User Offline
Joined: 19th Apr 2017
Location:
Posted: 2nd May 2017 01:53
I am new to tier2 and I'm working with the mac template. I initially set my media folder in code to /media and created the folder and put an image in it. I was able to load the image and it displayed on the screen properly.

Now I am creating manager classes and they are in new folders in the same project. I try the load the image now from a manager class and I just get a white square now. In my manager i load it the same way with just the image name and I get an id back but the sprite I create is just white.

I guess I have two questions:
1) where are images supposed to go in the mac template?

2) if you load image from a class in a different folder do you have to adjust your path?

I appreciate any assistance.

RGBZ
6
Years of Service
User Offline
Joined: 19th Apr 2017
Location:
Posted: 2nd May 2017 12:14
Just wanted to put another thought out there. If I am using in agk.h in multiple files, when I create an image and get an unsigned int back, will that work to create a sprite from in another cpp file that has agk.h also declared ?

RGBZ
6
Years of Service
User Offline
Joined: 19th Apr 2017
Location:
Posted: 3rd May 2017 00:22
A little more info. I hard code the image and sprite id to be 1 it works. If I don't supply an id and let the command return me an id, I get back 100001 for both the image and the sprite and it shows as a white block.

Not sure why hard coding the ids makes a different, does anyone have any suggestions ?
RGBZ
6
Years of Service
User Offline
Joined: 19th Apr 2017
Location:
Posted: 3rd May 2017 01:39
Maybe i was wrong, I'm still having issues. Through many test scenarios it appears to me that you can't create an image in one cpp file and create the sprite in another cpp file. Even though the image got a valid id in the one cpp file it doesn't appear to work in the other cpp file creating the sprite.

If I do both operations in the same cpp file it works without an issue.

Any ideas?

Login to post a reply

Server time is: 2024-04-19 07:12:43
Your offset time is: 2024-04-19 07:12:43