RiK
New Member
Posts: 2
|
Post by RiK on Jun 20, 2004 18:28:33 GMT
is there a way to force z-ordering of the sprites using your system?
|
|
|
Post by syntaxerror on Jun 25, 2004 13:15:46 GMT
Currently sprites are z-ordered according to the order in which you extract them. Every time you extract a sprite from a pack it will be drawn over the top of all of the other extracted sprites:
pack=LoadPack("test.png") ball=GetPackedSprite("myball",pack) brick=GetPackedSprite("redbrick",pack) ship=GetPackedSprite("spaceship",pack)
In the above example the ship will appear in front of the ball and brick.
|
|
|
Post by Slenkar on Oct 10, 2004 22:39:36 GMT
I have 103 images in one pack so I cant extract them individually,I have to use countsprites() Is there a way to control which images are extracted first in the
for a =1 to numsprites extractimage,a next
loop?
|
|
|
Post by syntaxerror on Oct 18, 2004 12:18:48 GMT
Thats difficult Slenkar. As you know, the images are jumbled around in the packer if you add/resize/remove images.
One idea is to rename your images like this:
spr_0 spr_1 spr_2
etc ...
That way, you can extract by name in a guaranteed order:
For num=1 to 103 sprite(num)=GetPackedSprite("spr_"+Str$(num),pack) Next
|
|
|
Post by Slenkar on Oct 18, 2004 15:58:37 GMT
thanks that solved the problem
|
|
|
Post by RagTag on Feb 12, 2005 3:55:20 GMT
Lack of Z-Ordering with SpriteMaster is a real problem if you dynamically create and destroy sprites quite a lot. For example, if you have a bunch of aliens and shadows which appear under them, every time you create a new alien and shadow the shadow will be drawn over the top of existing aliens.
My solution is to separate things into "layers", which is done on a per-pack basis. For example, keep all your objects in one pack and all your shadows ( which will appear under objects ) in another pack.
Then you can ZOrder a layer ( a pack ) using this function :
Function ZOrderLayer(packIndex%,Order%) Local c.smContainer=Object.smContainer(packIndex) If c<>Null If c\mesh<>0 EntityOrder c\mesh,Order% End If End If End Function
Supply the PackIndex that LoadPack gives you and the zorder and you're golden.
You can also modify the code above to allow you to hide an entire layer or show it again.
|
|
|
Post by zhanhuichuangg on Oct 13, 2011 2:08:51 GMT
Well I believe we, the Americans of today, timberland boots are ready to act worthy of ourselves, ready to do what must be done to insure happiness and liberty for ourselves, our children, and our children¡¯s children. And as we renew ourselves here in our own land, timberland 3 eyes shoes will be seen as having greater strength throughout the world. We will again be the exemplar of freedom and a beacon of hope for those who do not now have timberland classic boat shoes. To those neighbors and allies who share our freedom, we will strengthen our historic ties and assure them of our timberland 6 inch boots and firm commitment. We will match loyalty with loyalty. We will strive for mutually beneficial relations. We will not use our mens timberland 6 inch boots to impose on their sovereignty, for our own sovereignty is not for sale. As for the enemies of freedom, those who are potential adversaries, they will be reminded that peace is the highest aspiration of womens 14 timberland boots. We will negotiate for it, sacrifice for it; we will not surrender for it -- now or ever. Our timberland mens chukka should never be misunderstood. Our reluctance for conflict should not be misjudged as a failure of will. When action is required to preserve our national security, we will act. timberland boots women will maintain sufficient strength to prevail if need be, knowing that if we do so, we have the best chance of never having to use that strength. Above all black timberland boots must realize that no arsenal or no weapon in the arsenals of the world is so formidable as the will and moral courage of free timberland boots for men. It is a weapon our adversaries in today's world do not have. It is a weapon that we as timberland 6 inch premium do have. Let that be understood by those who practice terrorism and prey upon their neighbors. timberland shoestimberland boat shoestimberland boots sale ZHC
|
|