Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fall Banner 2023 Idea - Dev Diary
#10
So one lack that we have in QB64 is there is no shape with a stroke.

We can of course make our own, and it's not too hard.

We'll need to create some higher level classes for some primitives though.

`rec(x, y, w, h, fill_color, stroke_color, stroke_width)`
`cir(x, y, w, h, fill_color, stroke_color, stroke_width)`
`tri(x, y, w, h, fill_color, stroke_color, stroke_width)`

We will also have a single `shape(x, y, w, h, fill_color, stroke_color, stroke_width)` which will be used by the wrappers `rect, circ, tri`

Line also needs a wrapper because we want to draw thick lines.
`lin(start_x, start_y, end_x, end_y, stroke_color, stroke_width)`

Line will not be using shape. It will be it's own thing.

Thinking about this a little deeper, if we added rotation and an origin to rec, we could get thick lines.

For example:
`rec(x, y, w, y, fill_color, stroke_color, stroke_width, angle, origin_x, origin_y)`

We could use this for `lin`... assuming:
origin_x = start_x + width\2 (center point of the x)
origin_y = start_y + height\2 (center point of the y)

This depends on some rotation that can handle that, I don't have any libraries for that, but I have seen others using RotoZoom example in the wiki.

There are also some parameters in CIRCLE that we might want to consider separately as a new higher level shape. Like `halfcir` by using:
https://qb64phoenix.com/qb64wiki/index.php/CIRCLE Wrote:Negative radian values can be used to draw lines from the end of an arc or partial ellipse to the circle center.

Maybe something like:
`hcir(x, y, w, h, fill_color, stroke_color, stroke_width)` which would use negative radians to make half a circle (presuming i can figure it out)

Further, a nice shape to add would be a polygon
`poly(x, y, w, h, fill_color, stroke_color, stroke_width, angle, origin_x, origin_y, points)`

If we got poly working we could use it for line, rectangles, triangles, diamonds, hexes, etc.

While it would be nice, I'm going to skip it for now. maybe we will add that later.

We would still use all the default shape types, lin, tri, rec, cir, hcir, etc. even if we had `poly`. it would just use poly to do it's work and wrap poly for those simpler ones.
grymmjack (gj!)
GitHubYouTube | Soundcloud | 16colo.rs
Reply


Messages In This Thread
Fall Banner 2023 Idea - Dev Diary - by grymmjack - 09-02-2023, 12:59 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 01:11 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 01:17 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 01:45 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 02:01 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 02:07 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 02:33 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 02:40 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 02:49 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 03:18 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 03:29 AM
RE: Fall Banner 2023 Idea - Dev Diary - by dbox - 09-02-2023, 03:37 AM
RE: Fall Banner 2023 Idea - Dev Diary - by dbox - 09-02-2023, 02:02 PM
RE: Fall Banner 2023 Idea - Dev Diary - by bplus - 09-02-2023, 03:29 PM
RE: Fall Banner 2023 Idea - Dev Diary - by bplus - 09-06-2023, 01:59 PM



Users browsing this thread: 1 Guest(s)