IOS - Images only display border

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
uniqueiosfreak
Posts: 8
Joined: Sat Jan 15, 2011 5:32 pm

IOS - Images only display border

Post by uniqueiosfreak » Sat Jan 15, 2011 5:41 pm

Newbie here, C and Realbasic experience - but less time now days and my brain gets sore faster! - hence Rev.

I've created a 2d array to hold my game field map and I have letters in my array based on which I'll add pre-created icon images to the screen to build my levels.

The problem I have, is that I've added a land image and a water image (I've tried PNG and JPG's) - they are around 25 x 48 in size.
I've done this by selecting my graphic file as the source within a newly added image control.
I can see them before simulation, but when I simulate, I can only see the borders.
I've dug around some example code but can't understand what I'm not doing?
Also, would adding an image and then figuring out the code to clone and paste multiple versions to build my grid/level be the best method or would another control be more appropriate?

Thanks in advance.

Klaus
Posts: 14183
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: IOS - Images only display border

Post by Klaus » Sat Jan 15, 2011 6:45 pm

HI uniqueiosfreak,

I have to confess confess that, even after reading this posting a couple of times,
I have neither an idea what you are talking about nor what your problem is :D


Best

Klaus

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4168
Joined: Sun Jan 07, 2007 9:12 pm

Re: IOS - Images only display border

Post by bn » Sat Jan 15, 2011 7:01 pm

Hi unique,

welcome to the forum.

From what I gather you are probably running into the problem that referenced images need the files of the images where the reference points to.
If you move the files or you built a standalone, chances are the the paths are not valid anymore.

The easiest fix would be to import as control -> image file... instead of referenced control.
The image imported as control stays in the stack and is saved with the stack. So no problem with standalones. You can hide or show them via script.

Alternatively you could put your image files into a folder that you include in your standalone settings. On the simulator you would reference them by the specialFolderPath("engine") function see iOS release notes under help.

Maybe I also misunderstood your problem, but then this is maybe part of terminology which one has get used to.

Kind regards

Bernd
C and Realbasic experience - but less time now days and my brain gets sore faster!
That is why my doctor told me to use Livecode, C does all sort of things to human beings... :)

uniqueiosfreak
Posts: 8
Joined: Sat Jan 15, 2011 5:32 pm

Re: IOS - Images only display border

Post by uniqueiosfreak » Sat Jan 15, 2011 7:08 pm

Thanks Guys, import as control has my image showing correctly now. Much appreciated.

I just need to replicate it now.

Basically, I have a land image and a water image and based on my 2d array, I'm laying my images down in a tile fashion to create a game level layout.

Sorry for initial explanation and thanks for the swift answer.

Post Reply