nSprite does not draw anything...

Blitz3D Forums/Blitz3D Userlibs/nSprite does not draw anything...

Rook Zimbabwe(Posted 2005) [#1]
I am using nSprite (Free version but I plan to upgrade as soon as I get my net paycheck!) ANYWAY I am using it to see what kind of a cardgame I can make. I have a PNG like this:

And my code is:
But it draws NADA!!! I know it did a turn through the for/next loop but???

ALSO what is nS_SpriteCount it isn't documented???

RZ


big10p(Posted 2005) [#2]
Well, if ns_LoadAnimImage() works like the regular blitz LoadAnimImage (never used nSprite, myself), then I think you need to change this line:
card = nS_LoadAnimImage("cards.png",71,96,1,51)

to this:
card = nS_LoadAnimImage("cards.png",71,96,0,52)


Basically, I don't think your card image is getting loaded, due to the incorrect params.


Rook Zimbabwe(Posted 2005) [#3]
Nope... still dark...


BlackJumper(Posted 2005) [#4]
Stick your RenderWorld and Flip just after the nS_DrawImage line to see what is going wrong... it looks as if you are looping the placement of the cards right off the bottom of the screen before you get a chance to see them !!


Rook Zimbabwe(Posted 2005) [#5]
I did the same without nsprite and it worls really well... but I wanted a handle on all the cards... Let me try again Blackjumper...

I see what you mean... it is only drawing 1 card, but it really draws three cards soooo fast that it draws 1 sprite with three different faces...

Hmmm... Can I create a deck then using nSprite and manipulate it... Let me try something.

RZ


Rook Zimbabwe(Posted 2005) [#6]
Still doesn't draw more than 1 sprite though the sprite conter says there is 3... CONFUSED!!!

But look at this with blitz using regular blitz3d...
What am I doing wrong... I know I am missing something simple but important...


BlackJumper(Posted 2005) [#7]
I think you are misunderstanding what nSprite does.

In your Blitz only version you are using DrawImage to put pixels onto the BackBuffer and then flipping it to the screen.

In the nSprite version you are using nS_DrawImage but only have a single sprite surface to draw to !!! So every call to nS_DrawImage overwrites the previous one. You will need to nS_CopyImage or nS_CreateImage to get more than one sprite (i.e. card) to play with.

... at least I think that is what is happening


Rook Zimbabwe(Posted 2005) [#8]
Yeah I am thinking that as well... I recoded it a bit and tried to create a bunch of single images based on the cards images and then plop them... still plugging at it...

But you are right... only 1 sprite to work with unless a createimage with a new handle... If I called the new image by the card number then I could just drawimage by card number and solve most of my probs... let me code on that!