I've been playing around with the VGAGUI.ARC command hoping to make a custom gauge.
Alas, it is too constrained.
It's great for something like a VU meter but I think it could be made more general purpose.
The current options {VGAGUI.ARC (x, y, width, height, value [,thickness=10])} are a little too limiting.
May I propose something like:
VGAGUI.ARC (x, y, radius1, radius2, startangle, endangle [,colour])
or maybe.
VGAGUI.ARC (x, y, radius1, startangle, value, thickness [,colour])
VGAGUI.ARC
-
- Posts: 351
- Joined: Tue Jun 21, 2022 2:17 pm
- Location: South coast UK
- Has thanked: 187 times
- Been thanked: 113 times
- cicciocb
- Site Admin
- Posts: 2095
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 450 times
- Been thanked: 1385 times
- Contact:
Re: VGAGUI.ARC
Hello,
probably this command has been badly named ARC because it is in fact an ARC meter indicator.
For your info, you can use a negative number for the "thickness" (see what happens).
Probably what you want is something like VGA.ARC to draw just an arc?
For your reference, this is (presque) the code that draws the arc
probably this command has been badly named ARC because it is in fact an ARC meter indicator.
For your info, you can use a negative number for the "thickness" (see what happens).
Probably what you want is something like VGA.ARC to draw just an arc?
For your reference, this is (presque) the code that draws the arc
Code: [Local Link Removed for Guests]
sub draw_arc(v)
local tmp
tmp = v/100 *(1.5 * PI) - 0.25*PI
cx = 700
cy = 190
inner = 50
outer = 60
for a = -0.25*PI to 1.25*PI step PI/90
xi = cx - fix(cos(a) * inner)
yi = cy - fix(sin(a) * inner)
xo = cx - fix(cos(a) * outer)
yo = cy - fix(sin(a) * outer)
if (a < tmp) then
vga.line xo,yo, xi, yi, red, 2
else
vga.line xo,yo, xi, yi, blue, 2
end if
next a
vga.show
end sub
-
- Posts: 351
- Joined: Tue Jun 21, 2022 2:17 pm
- Location: South coast UK
- Has thanked: 187 times
- Been thanked: 113 times
Re: VGAGUI.ARC
Yes, just draw an arc of specified start angle,end angle, colour, width etc. at location x,y.
I've already made a start doing it "old school" and came up with something not far from what you posted above!
I've already made a start doing it "old school" and came up with something not far from what you posted above!