I want to divide the screen into three pages vertically so rhe middle one can scroll up and down under the top and bottom pages.
I am having trouble with creating a page of a particular colour say red. I am guessing the alpha value is for transparency.
I tried this to create a thin strip on the top of the page:
Graphics
Graphics clear 1,1,1
n$ = "title area"
PAGE n$ color 1,0,0,1
Page n$ Frame 0,0,30,30
It doesn't seem to work.
Cheers
Create a page
- rbytes
- Posts: 1338
- Joined: Sun May 31, 2015 12:11 am
- My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet - Location: Calgary, Canada
- Flag:
- Contact:
Re: Create a page
You are off to a good start. Some of the page commands only work after the page has been created. Check the order of this code. It will do what you want.
Code: Select all
Graphics
Graphics clear 1,1,1
n$ = "title area"
page n$ set
page n$ show
PAGE n$ color 1,0,0,1
Page n$ Frame 100,100,300,200
pause 3
The only thing that gets me down is gravity...
- rbytes
- Posts: 1338
- Joined: Sun May 31, 2015 12:11 am
- My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet - Location: Calgary, Canada
- Flag:
- Contact:
Re: Create a page
Here is a page you can drag around the screen. If you only want it to move on the x axis, make the y axis a constant. Or vice versa.
Code: Select all
Graphics
Graphics clear 1,1,1
n$ = "title area"
page n$ set
page n$ show
PAGE n$ color 1,0,0,1
Page n$ Frame 100,100,300,200
do
get touch 0 as tx,ty
get touch 1 as dx,dy
if tx>-1 then page n$ at tx-150,ty-100
until dx>-1
pause 3
The only thing that gets me down is gravity...
Re: Create a page
Ok the first one works well.
I will try the other bit of coding later. It seems straightforward.
Also
Does the alpha value determine which page is on top?
Cheers and thanks
I will try the other bit of coding later. It seems straightforward.
Also
Does the alpha value determine which page is on top?
Cheers and thanks
- rbytes
- Posts: 1338
- Joined: Sun May 31, 2015 12:11 am
- My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet - Location: Calgary, Canada
- Flag:
- Contact:
Re: Create a page
No, the active page is effectively the top page. You make a page active with the SET command and visible with the SHOW command.
The only thing that gets me down is gravity...
Re: Create a page
So I want the middle page to scroll under the top and bottom page while they stay visible. Can this be done.
Also what is the alpha value for?
Cheers
Also what is the alpha value for?
Cheers
- rbytes
- Posts: 1338
- Joined: Sun May 31, 2015 12:11 am
- My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet - Location: Calgary, Canada
- Flag:
- Contact:
Re: Create a page
Alpha refers to transparency. So an alpha value of 0 makes something invisible, and an alpha value of 1 makes it fully visible. Any value in between will create a ghosted effect, where objects underneath can partially show through. I will create a three page sample, and let's see if it fills your need.
The only thing that gets me down is gravity...
Re: Create a page
Ok thanks. I should've able to work it out from here.Don't go to any trouble.Ken
- rbytes
- Posts: 1338
- Joined: Sun May 31, 2015 12:11 am
- My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet - Location: Calgary, Canada
- Flag:
- Contact:
Re: Create a page
No trouble. Here is a small sample of three pages. All are visible. The middle red page can be dragged sideways in either direction. To have the other pages cover it, I would define it first and them afterward. But in this code, I defined the middle page last, so it is on top of the blue and magenta pages. Because the red page has an alpha of .5, the pages behind it show through it.
Code: Select all
'Three-page example
Get screen size sw,sh
Graphics
Graphics clear 1,1,1
l$ = "above page"
m$ = "below page"
n$ = "title area"
' page at top of screen
PAGE l$ set
PAGE l$ show
PAGE l$ color 0,0,1,1
PAGE l$ Frame 0,0,sw,sh/3
' page at bottom of screen
PAGE m$ set
PAGE m$ show
PAGE m$ color 1,0,1,1
PAGE m$ Frame 0,2*sh/3,sw,sh/3
page n$ set
page n$ show
PAGE n$ color 1,0,0,1
PAGE n$ alpha .5
Page n$ Frame sw/2,sh/4,sw,sh/2
do
get touch 0 as tx,ty
get touch 1 as dx,dy
if tx>-1 then page n$ at tx-sw/2,sh/4
until dx>-1
end
- Attachments
-
- E697B99A-B486-47E9-B895-E83ADF3F8F74.png (56.95 KiB) Viewed 3812 times
The only thing that gets me down is gravity...
Re: Create a page
Ok I have pasted the code in and checked it out. It works well and is nice and brief. I will try and fit it in with what I want.
However:
It looks like I may have been wasting my time( and yours) since I can't use a created page as a container for graphic objects such as recrtangles and lines.
It seems they can only be drawn on the original page/background.
Is this true?
However:
It looks like I may have been wasting my time( and yours) since I can't use a created page as a container for graphic objects such as recrtangles and lines.
It seems they can only be drawn on the original page/background.
Is this true?