Reverse Viewport
Re: Reverse Viewport
As I mentioned before, I think, you can do this with a move on the viewport. But that would only work for that one number. If you do this on a running text, then it would apply to all of numbers.
The alternative would be to use two running texts which are in sync and have different viewports.
The alternative would be to use two running texts which are in sync and have different viewports.
- Keith Baxter
- Posts: 4685
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Botswana
Re: Reverse Viewport
Sparky,The Artful Dodger wrote: ↑Thu Aug 11, 2022 6:57 pm Keith:
Here is a simplified version of my problem. As the text goes down, I need for it not to show up in the blue box (rather, gradually disappear) but to continue moving down, and then gradually show up as it comes from beneath the blue box. All the while the blue box must remain transparent.
The version I gave you a video of had the numbers simply popping out and then popping back in once clear of the box. But I don't like that! For me, the hard part is keeping the blue box transparent so that i can put a number in it!
I wish you success and I thank you profusely!
Sparky
________________________________________________________________________________________________________________________
That can easily be achieved.
In the code below I created a background color for the "Block" canvas.
Then I created a "airspeed" canvas. This canvas should not have a background. Just your wheel text. I just added a arbitrary time text in there.
Code: Select all
Panel = canvas_add(0, 0, 200, 100)
Block = canvas_add(40, 40, 100, 50)
airspeed = canvas_add(40, 40, 100, 50)
--
Robo_50_H_HAR_VAC = "font:roboto_regular.ttf; size:50px; color: #80FF80; halign:right; valign:center;"
--
LineNumber = 180
--
canvas_draw(Panel, function()
_rect(3, 3, 195, 95)
_stroke("green", 5)
end)
--
canvas_draw(Block, function()
_rect(3, 3, 95, 45)
_fill("red")
_rect(3, 3, 95, 45)
_stroke("blue", 5)
end)
--
canvas_draw(airspeed, function()
_txt("14h30", Robo_50_H_HAR_VAC,100,25)
end)
--
function CreateMovingText(Index, Value)
canvas_draw(Panel, function()
_txt("Now is the time", Robo_50_H_HAR_VAC, 250, Index)
end)
end
--
function Setup(LineNo)
print("LineNo", LineNo)
CreateMovingText(LineNo, Value)
LineNo = LineNo + 40
end
--
Count = 180
MyTimer = timer_start(250, 250, Setup)
print("Count = ", Count)
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board, 32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card
-
- Posts: 204
- Joined: Sat Jul 09, 2022 3:20 pm
Re: Reverse Viewport
Hi Keith:
No joy - the blue box isn't transparent! That's the problem I've been having. It needs to be transparent except for the lines around it! And of course the lettering but that changes all the time!
That's why I suggested to Ralph a "cutout" function that would surgically remove everything in its area below it.
Sorry, but thanks for trying!
Sparky
No joy - the blue box isn't transparent! That's the problem I've been having. It needs to be transparent except for the lines around it! And of course the lettering but that changes all the time!
That's why I suggested to Ralph a "cutout" function that would surgically remove everything in its area below it.
Sorry, but thanks for trying!
Sparky
- Keith Baxter
- Posts: 4685
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Botswana
Re: Reverse Viewport
Sparky,The Artful Dodger wrote: ↑Thu Aug 11, 2022 8:59 pm Hi Keith:
No joy - the blue box isn't transparent! That's the problem I've been having. It needs to be transparent except for the lines around it! And of course the lettering but that changes all the time!
That's why I suggested to Ralph a "cutout" function that would surgically remove everything in its area below it.
Sorry, but thanks for trying!
Sparky
Then at lease for me I do not understand.
All canvases are transparent.
Z order determines what shows on top.
Lets spend some time tomorrow on the discord and get you issue sorted.
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board, 32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card
-
- Posts: 204
- Joined: Sat Jul 09, 2022 3:20 pm
Re: Reverse Viewport
Hi, Keith:
That (Discord) would be fine. However, a few minutes ago I had a thought that might work so I'll try that first thing before I trouble you further.
As to your question, I believe that all 'things' bordered by strokes are transparent; but you used one that wasn't transparent (to block the letters). I need to block the letters with something transparent - but that won't block the letters.
I'll let you know how my fresh idea works.
But, above all, thank you for volunteering your valuable time to help me. I appreciate it immensely.
Sparky
That (Discord) would be fine. However, a few minutes ago I had a thought that might work so I'll try that first thing before I trouble you further.
As to your question, I believe that all 'things' bordered by strokes are transparent; but you used one that wasn't transparent (to block the letters). I need to block the letters with something transparent - but that won't block the letters.
I'll let you know how my fresh idea works.
But, above all, thank you for volunteering your valuable time to help me. I appreciate it immensely.
Sparky
- Keith Baxter
- Posts: 4685
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Botswana
Re: Reverse Viewport
Sparky,
Correct. Everything not drawn on a canvass is transparent.
Drawn items take present in Z order.
Canvases are also layered in Z order.
Items drawn within a canvas do no have to be within the canvas x,y,W,h.
Keith
Correct. Everything not drawn on a canvass is transparent.
Drawn items take present in Z order.
Canvases are also layered in Z order.
Items drawn within a canvas do no have to be within the canvas x,y,W,h.
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board, 32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card
Re: Reverse Viewport
He doesn't want a blue box I guess, but a area in which the numbers don't show.
-
- Posts: 204
- Joined: Sat Jul 09, 2022 3:20 pm
Re: Reverse Viewport
Hi, Ralph:
Close. I need a transparent outlined blue box, under which the tape values pass, but, because I want to place the exact speed in the blue box, I need to hide the tape values which pass beneath it.
Long sentence - sorry!
Sparky
Close. I need a transparent outlined blue box, under which the tape values pass, but, because I want to place the exact speed in the blue box, I need to hide the tape values which pass beneath it.
Long sentence - sorry!
Sparky
Re: Reverse Viewport
Do you have an image maybe?
- Keith Baxter
- Posts: 4685
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Botswana
Re: Reverse Viewport
Ralph,
Well if he uses the code I posted then the "Now is the time" will not show in front of the red _fill(). They will be behind the red _fill() and the " wheel" numbers ("14h30") will be on top of the red _fill().
The _fill() could be any color.
I do not understand the issue.
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board, 32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card