Screen Scrolling

Previous topic - Next topic

aroldo

GLB Community,

I am developing and app for mobile devices that retrieves text and information from the web and then displays to the user.
Since the information will not fit the screen the user need to scroll up or down touching the screen of the device.
On the screen I will have images and text.

Does any one knows a sample or GLB command that can help me manage the screen scrolling?
[a http://apd-games.com/][img http://apd-games.com/images/APDGames135.png][/a]
MacBook Pro OS X El Capitan
XCode Version 7
iPhone 6 running  iOS 9
iPad Mini running  iOS 7.1
Galaxy S5
Dell Latitude Windows 8 Enterprise
Palm Pre, Palm Pre2

erico

I´m not sure if I grasp what you mean, but you can display and print on a huge vertical image and move its y position.
You must be looking for something more complex maybe?

aroldo

If I use a native code for iOS or Palm, if I print text line or an image that is taller the the device height the OS will enable the scrolling feature.
I GLB I have to simulate that, using the mouse y position and the extended printed area.
[a http://apd-games.com/][img http://apd-games.com/images/APDGames135.png][/a]
MacBook Pro OS X El Capitan
XCode Version 7
iPhone 6 running  iOS 9
iPad Mini running  iOS 7.1
Galaxy S5
Dell Latitude Windows 8 Enterprise
Palm Pre, Palm Pre2

CW

#3
Traditional methods of smooth scrolling would be far too slow in GLbasic because you would have to rely on our old friend, the SetPixel command across the entire screen. (If you can be happy with pure text and do not mind some major jerkiness in the scrolling, than the simple GLbasic Print String$,x,y command could handle that.) For smooth scrolling, the task may be doable using inline C code; but first I would try Enrico's suggestion, of mapping the entire page (with pictures) to a virtual screen in memory, doing a GRABSPRITE of the virtual screen to produce a sprite which is far larger than the actual screen, and then sliding the sprite around for display to simulate scrolling. I honestly don't know that this approach would work, but it seems reasonable, and it would be fun to try.
-CW

erico

Enrico Morricone? :D :D

You may wanna try USESCREEN instead of GRABSPRITE just to be sure on mobiles.
How big would those texts+pics be? Maybe divide them into sets of sprites?

CW

#5
OOps! Sorry about that Erico. I don't know where that n came from.  :-[
-CnW

aroldo

Enrico,

The screen height size will vary, in some devices 640, 960, 1024, 2048.
Every time the uses touches the screen up to see if the messages that are is beyond the screen height I will have to scroll the entire screen.

Using in Line C code is an option but I will have to do a function for each device I plan to support.
[a http://apd-games.com/][img http://apd-games.com/images/APDGames135.png][/a]
MacBook Pro OS X El Capitan
XCode Version 7
iPhone 6 running  iOS 9
iPad Mini running  iOS 7.1
Galaxy S5
Dell Latitude Windows 8 Enterprise
Palm Pre, Palm Pre2

hardyx

#7
You can make your own code to draw text in a memory screen (USESCREEN) and draw using an offset. Or you can use DDGui that is more easy and use a multiline Text or List control wich supports scroll. If you want to show only text, it's not complex to draw lines beggining with the index you want to scroll.

erico

At least Enrico is better then Rico Suave (like people used to call me in the US... :P)

Arnoldo, I didn´t mean the device screen resolution. I meant the amount of text you need to scroll, would it happen to be like a great amount of text? Let´s say enough you would need 10 screens combined (like 720x12800 on a note II)? That is if you choose the USESCREEN method better described by Hardnyx, I believe you would have to brake it down into sets of screen so not to force the mobile too much. Or create the screen kind of on-the-fly and work with a couple.

Using USESCREEN you are not going to be able to copy/paste the text, you don´t plan to have that feature right?

Maybe DDGnui is a better option, but I never tried it.

kanonet

Why not just have a look in various GUI code to see how they did scrolling of text fields? E.g. have a look at DDgui.
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64