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 / About Scroll View of Certain portion of screen

Author
Message
Subbir
11
Years of Service
User Offline
Joined: 20th Jun 2012
Location:
Posted: 1st Nov 2012 07:58
I want to scroll down and up the red portion of the screen which is attached with the image. Is this possible with AppGameKit? Because the SetViewOffset function works with the whole screen. But I need to move that red portion only like a scroll view. Is that possible? If, then can anyone give any hints or sample code of it?

Subbir Rahman

Attachments

Login to view attachments
BraindeaD
16
Years of Service
User Offline
Joined: 30th Mar 2008
Location:
Posted: 1st Nov 2012 09:09 Edited at: 1st Nov 2012 09:28
Hi Subbir,
I don't test it but maybe it helps you:
http://www.appgamekit.com/documentation/Reference/Core/SetScissor.htm
Another option: scroll all the screen as usual and paint the marquee over the scroll using sprite depths.
7RS
11
Years of Service
User Offline
Joined: 10th May 2012
Location:
Posted: 1st Nov 2012 19:04
You can easy fix to screen the other part and leave movable the red part.

If your NON Red part is a single sprite just FixSpriteToScreen(sprite,1)

If is made by multiple sprite you have to repeat the operation to all sprites.
Marl
12
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 1st Nov 2012 19:59
Use the image as a screen mask

1) Make the Red portion transparent
2) Load the image and assign to a sprite
3) Fix the sprite to the screen
4) make the sprite the size of the screen



Now any sprites you create that are to be "scrolled";
1) Set their depth to be below the mask sprite used above
2) Don't fix to the screen



Now changing the view offset ( and zoom for that matter ) will only affect the sprite not fixed to the display.

As you can scroll around and zoom, sprites on the world plane will be visible through the "window" portion of the fixed mask sprite.

Login to post a reply

Server time is: 2024-04-27 16:56:20
Your offset time is: 2024-04-27 16:56:20