Return to previous page | Return to menu | Go to next page


8-8. Normal scroll screen

The normal scroll screen “NBG0 to 3” can be scrolled vertically and horizontally and scaled (NBG0, NBG1 only). Here, we will explain these two functions together with a sample program.

Move normal scroll screen

The normal scroll screens “NBG0-3” can be moved vertically and horizontally by changing the scroll display position.
An image of this is shown below.

Figure 8-18 Scroll display position image

Use the library function “slScrPosNbg0 to 3” to move the scroll display position.
“SlScrPosNbg0-3” is also used to set the initial scroll position.

[void slScrPosNbg0-3 (FIXED posx, FIXED posy);]
Sets the display start position of the normal scroll screen “Nbg0 to 3”.
The scroll display position is determined by where the monitor is placed on the scroll map. The upper left corner of the monitor is the representative point, and one point on the scroll map is specified as a parameter.
For the parameter, substitute the XY coordinate value representing the scroll coordinate system.

If the scroll display position moves up / down / left / right and the scroll exceeds the display area, the scroll starts drawing again from the opposite end.

Figure 8-19 Processing when scrolling exceeds the display area

The following two sample programs (Lists 8-2 and 8-3) implement scroll horizontal movement and vertical / horizontal movement using SGL library functions.

List 8-2 sample_8_8_1: Horizontal movement of scroll

Flow 8-3 sample_8_8_1: Horizontal movement of scroll

List 8-3 sample_8_8_2: Vertical / horizontal scrolling

Flow 8-4 sample_8_8_2: Vertical / horizontal movement of scrolling


Return to previous page | Return to menu | Go to next page