Posted: 29th Nov 2011 11:47
Why doesn't it exist in AppGameKit? Do I seriously need a sprite number for every single thing displayed?

I have 20 identical images (glowing dot) that are displayed in a row to represent a timer. As time counts down, I display fewer dots.

This would be ideal:
+ Code Snippet
for i = 1 to dotCount
    paste sprite 1, i*20, 100
next i


Just seems easier managing sprite drawing that way than having to hide/show dozens of sprites.
Posted: 29th Nov 2011 13:51
You can use UV scaling on sprites which would do this using one sprite. Here is a useful thread: http://forum.thegamecreators.com/?m=forum_view&t=191576&b=41
Posted: 29th Nov 2011 15:30
I also used paste sprite in DBP but doing so in AppGameKit would be too slow so you have to do it all with sprites. The best part about AppGameKit is that you can do something like this:
+ Code Snippet
dim dot[10]
for i = 1 to 10
   dot[i] = createsprite(image)
next i


Now you can refer to the sprites as dot[#]. Makes coding spites so much easier.
Posted: 29th Nov 2011 18:19
AGK uses a batch render that groups sprites as much as possible to minimise state changes which requires persistent sprites. Paste Sprite would technically be possible but would require drawing sprites one at a time which would impact performance.
Posted: 7th Dec 2011 23:52
I have added PasteSprite as a tentative possible command for 107 build. The back-end would simply stockpile the paste sprite commands and then create a batch for rendering in one go. Paul's back-up plan of rendering one by one is also an option if the performance hit is not too severe. I agree it's sorely missed when you come from DBP and find a big hole where Paste Sprite used to be
Posted: 8th Dec 2011 0:41
Lee:
I don't miss PasteSprite at all anymore, and I used it all the time in DBP. What I do miss are creating my own bitmap, draw to that and make my own images.
Posted: 8th Dec 2011 1:37
I know many devices that won't thank you for creating bitmaps and images on the fly That said, please do post your ideas on the issues board and I'll mark them as feature requests for future mulling. If you can back the request up with usage cases to make a strong argument for them, it will make the decision easier.
Posted: 8th Dec 2011 1:53
Lee:
No hurry, focus on other things for now
Posted: 8th Dec 2011 9:43
What devices won't like creating bitmaps on the fly? Is it B level OSes like Bada, that almost no one is using? Or are we talking about iOS and Android?

I desperately need this feature, at least on iOS!!!!!
Posted: 8th Dec 2011 9:44
What does Paste Sprite do exactly? Just put a sprite on a screen position and leave it there? How will you be able to delete or move that sprite then?
Posted: 9th Dec 2011 0:16
PASTE SPRITE would only paste the sprite for one cycle, then you would SYNC to render it to the screen and then then SYNC command would clear the screen for the next cycle of rendering. You can use this command to paste the entire tile set of your level to the screen rather than creating a sprite for each tile in the game, and there are a number of techniques that lend themselves very well to the paste sprite approach to things including the simple control of draw order.
Posted: 9th Dec 2011 0:22
PASTE SPRITE would only paste the sprite for one cycle, then you would SYNC to render it to the screen and then then SYNC command would clear the screen for the next cycle of rendering. You can use this command to paste the entire tile set of your level to the screen rather than creating a sprite for each tile in the game, and there are a number of techniques that lend themselves very well to the paste sprite approach to things including the simple control of draw order.

I want that now

I get an huge memory drain by using 3000 sprites for my floor
Posted: 9th Dec 2011 8:48
So basically you would do PasteSprite(MySprite, 10, 10) and have it in your loop until you want to move it
Posted: 9th Dec 2011 12:13
Hi all,
Lee, please keep in mind the possibility of paste sprite with rotation, resizing, alphablending... something like this, maybe:

pastesprite(image_num, x, y, rotation, size, alpha)

or with previous modificators that affects how the image is drawn...

setrotation(90)
setalpha(255)
setsize(2)
pastesprite(image_num,x,y)

Thanks in advance.
Posted: 9th Dec 2011 14:31
Lee, please keep in mind the possibility of paste sprite with rotation, resizing, alphablending... something like this, maybe:

It would paste the sprite exactly as it is, so if you rotate/scale the original sprite, the pasted one would be too.
Posted: 9th Dec 2011 14:59
Sorry, I misunderstood. I thought that it would draw an image not a sprite itself...
Just a question, what if i do two pastesprite() commands with the same sprite id in different locations in the same sync cycle? I suppose that sprite will be written in the last couple of coordinates, right?

Regards.
Posted: 9th Dec 2011 15:02
No, it'll appear in both positions.

Paste sprite is like a stamp, stamping a copy of the sprite to wherever you paste it on screen.
Posted: 9th Dec 2011 15:10
So in essence, you would rotate and resize the original sprite and paste it. rotate it again, and paste a new copy, etc...

then Sync
Posted: 9th Dec 2011 15:28
Ahhh, ok, ok... I understand now! I like the idea.
Would be nice to do this with images too, without having to create a sprite before. Just load image and paste it.
Thanks guys!
Posted: 10th Dec 2011 12:40
Why not having the whatever resolution is selected, as a background sprite that you paste stuff on? and also draw and plot to?