User |
Post |
3:21 am
August 10, 2008
|
jazzmic
Member
|
|
|
|
|
posts 6
|
|
|
I'm working on a card game. To do that I'm loading the images as ImageViews and I can move them around without a problem. What I don't know is how to get rid of them when I don't need them anymore. Is “removeFromSubview” enough or does that leave them in memory, just not represented on screen?
The other question is, how can I control the layer order in which they are found. That would be, how can I know the depth in which they are found and how can I put them in a different depth, like when I click on one, it moves to the top of the cards?
Thankyou
|
|
9:11 am
August 10, 2008
|
Brandon
Admin
|
|
brandontreb
|
|
|
posts 32
|
|
|
Hmmm…. Is there a reason that you are not doing this project in OpenGL ES? It seems like it would be much easier to handle hiding/showing/layering your card objects. That would be my suggestion as it seems to be much easier to do it that way than to do it using ImageViews.
But to answer your question about layering, I have found that the order of the layers seems to be dependent on the order in which you declare your visual components. I have yet to see a method that allows you to change the order layers. If you do find one, please post it here as I think some other forum members were interested in this functionality.
|
|
10:20 am
August 10, 2008
|
crazyiez
Member
|
|
Wright State University
|
|
|
posts 25
|
|
|
jazzmic said:
What I don't know is how to get rid of them when I don't need them anymore. Is “removeFromSubview” enough or does that leave them in memory, just not represented on screen?
About the memory part. If you allocated memory for something then you have to release it otherwise your just wasting memory. you have to take it off the heap.
kind of like this *might be a poor example but it works*
newEntry = [[funnyEntry alloc] init];
then you have to release that so if you allocated your cards release them when your done with them.
[newEntry release];
hope this helps in anyway.
|
|
11:09 am
August 10, 2008
|
jazzmic
Member
|
|
|
|
|
posts 6
|
|
|
Brandon: well.. I haven't learnt any OpenGL, and although I have thought of looking into it, I'm having enough problems with ObjectiveC, but will do!
Crazyies: That was embarassing (for me). True, you're absolutly right, thanks.
I've looked a litle more into the question I posted and it seems all could be done with CALayers, but then I think I loose the part where I can controll the images with the touch events…. hm… I'll look more into this.
|
|
11:44 am
August 10, 2008
|
crazyiez
Member
|
|
Wright State University
|
|
|
posts 25
|
|
|
4:49 am
August 19, 2008
|
angadsk
New Member
|
|
|
|
|
posts 1
|
|
|
crazyiez said:
NP. Glad i was right!
Hi Jazzmic,
I need your help. I need to display a set of 9 images in a tabular format of 3X3. and wanna move these images..
Can you help me in this .. its kind of similar to the activity which you are doing .. I am new at this programming and i do this for fun.
Waiting for a positive response.
Regards
Angad
|
|