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 / Scrolling Numbers

Author
Message
ManOfActionTM
12
Years of Service
User Offline
Joined: 16th May 2011
Location: Sahuarita, Arizona
Posted: 14th Oct 2011 04:56
Maybe I'm just missing something obvious, but is there a way to create a kind of viewport where something like the following occurs:

0
9
8
7
---
|6|
---
5
4
3
2
1
0

In this case, only the 6 would be visible. But one could scroll image file inside the box up or down to present a new number and a scrolling effect.

Thanks for any solutions!
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 14th Oct 2011 11:34 Edited at: 14th Oct 2011 12:24
Creating viewports is a different question but scrolling through numbers is very possible.

The best way to achieve what you want (I think) would be to have 10 sprites using images of the numbers.
1-check for input
2-if input increases the current number then set the size of the current number sprite smaller in 'Y' and move it down
3-if input decreases the current number then set the size of the current number sprite smaller in 'Y' and move it up
4-as the current sprite is getting smaller increase the size of the next sprite and move it into place...

That's how I'd do it.

EDIT: Attached is an example, here's the code:


Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-04-25 03:15:28
Your offset time is: 2024-04-25 03:15:28