Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / paste sprite?

Author
Message
Phaelax
DBPro Master
20
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
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:


Just seems easier managing sprite drawing that way than having to hide/show dozens of sprites.

"You're not going crazy. You're going sane in a crazy world!" ~Tick
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
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

Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 29th Nov 2011 15:30 Edited at: 29th Nov 2011 15:31
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:


Now you can refer to the sprites as dot[#]. Makes coding spites so much easier.

Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
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.
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
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

I drink tea, and in my spare time I write software.
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 8th Dec 2011 00: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.

LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 8th Dec 2011 01: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.

I drink tea, and in my spare time I write software.
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 8th Dec 2011 01:53
Lee:
No hurry, focus on other things for now

bjadams
AGK Backer
15
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 8th Dec 2011 09: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!!!!!
bjadams
AGK Backer
15
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 8th Dec 2011 09: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?
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 9th Dec 2011 00: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.

I drink tea, and in my spare time I write software.
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 9th Dec 2011 00:22
Quote: "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
bjadams
AGK Backer
15
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 9th Dec 2011 08:48
So basically you would do PasteSprite(MySprite, 10, 10) and have it in your loop until you want to move it
BraindeaD
15
Years of Service
User Offline
Joined: 30th Mar 2008
Location:
Posted: 9th Dec 2011 12:13 Edited at: 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.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 9th Dec 2011 14:31
Quote: "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.

My signature is NOT a moderator plaything! Stop changing it!
BraindeaD
15
Years of Service
User Offline
Joined: 30th Mar 2008
Location:
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.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
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.

My signature is NOT a moderator plaything! Stop changing it!
bjadams
AGK Backer
15
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
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
BraindeaD
15
Years of Service
User Offline
Joined: 30th Mar 2008
Location:
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!
Impetus73
12
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
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?

----------------
AGK user - novice
Did Amiga / AMOS programming in the 90's, just started programming again with AGK.
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 11th Dec 2011 11:22 Edited at: 11th Dec 2011 11:22
Quote: "Why not having the whatever resolution is selected, as a background sprite that you paste stuff on? and also draw and plot to?"

I belive it is working that way?
he wrote something about draw to texture earlier that i belive is almost the same as the new paste sprite command.
I belive its the only solution on open gl when you dont use the old canvas support and use the more powerfull 3d engine for 2d.

I nead this command and i belive you can rewrite your cool 2d commands you wrote a while back.
line and circle something

Login to post a reply

Server time is: 2024-03-29 02:26:32
Your offset time is: 2024-03-29 02:26:32