Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Sprite Z Priority


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-18-2008, 12:18 PM
Junior Member
 
Join Date: May 2008
Posts: 19
Question Sprite Z Priority

Hi all!

I am currently using sprites for my app. But i need to know which sprites goes under which one.
For that I need to assign any 'z priority' to sprites. I read reference and i not found anything about that.
Is There any way to change 'z priority' of sprites?

Thanks in advance.

Best regards, fjsantos.
Reply With Quote
  #2 (permalink)  
Old 07-19-2008, 11:28 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,186
Default

Sprites are drawn to the screen in the same order they were added.
So the last sprite added will be the front-most sprite.
Reply With Quote
  #3 (permalink)  
Old 07-19-2008, 12:01 PM
Junior Member
 
Join Date: May 2008
Posts: 19
Default

Yep, I know that, but i need to have a sprite in front of the rest of sprites.
I add this sprite last, but when i create and recreate more sprites dinamically, the order obviously, change.

One solution, of course is destroy that front sprite, create sprites i need and recreate that front sprite, but that solution is time consuming and a bit boring.

There is another way to change that priority?

Best Regards, fjsantos.
Reply With Quote
  #4 (permalink)  
Old 07-19-2008, 12:15 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,186
Default

There is no need to really destroy and create a new sprite.
Try something like: (I haven't tested it)
Code:
sprite.MarkedForDelete = true
gw.DeleteMarkedSprites
sprite.MarkedForDelete = false
gw.SpriteAdd(sprite.Value)
sprite.IsActive = true
Reply With Quote
  #5 (permalink)  
Old 07-20-2008, 06:43 PM
Junior Member
 
Join Date: May 2008
Posts: 19
Default

Thanks Erel, that works like a charm!!

Best Regards, fjsantos.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
the background and sprite GallyHC Questions & Help Needed 4 06-01-2008 03:21 PM
Sprite (gif) Editor MM2forever Questions & Help Needed 0 04-04-2008 07:16 PM
Sprite problems willisgt Questions & Help Needed 2 02-28-2008 06:30 PM
Sprite library - V1.1 Erel Official Updates 0 02-28-2008 04:45 PM
New Sprite library Erel Announcements 2 01-24-2008 08:38 PM


All times are GMT. The time now is 03:50 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0