Added backdrop effects pipeline (blur)
This commit is contained in:
@@ -48,8 +48,7 @@ hellope_shapes :: proc() {
|
||||
draw.rectangle(
|
||||
base_layer,
|
||||
{20, 160, 460, 60},
|
||||
{255, 0, 0, 255},
|
||||
gradient = draw.Linear_Gradient{end_color = {0, 0, 255, 255}, angle = 0},
|
||||
draw.Linear_Gradient{start_color = {255, 0, 0, 255}, end_color = {0, 0, 255, 255}, angle = 0},
|
||||
)
|
||||
|
||||
// ----- Rotation demos -----
|
||||
@@ -79,18 +78,18 @@ hellope_shapes :: proc() {
|
||||
)
|
||||
|
||||
// Ellipse rotating around its center (tilted ellipse)
|
||||
draw.ellipse(base_layer, {410, 340}, 50, 30, {255, 200, 50, 255}, rotation = spin_angle)
|
||||
draw.ellipse(base_layer, {410, 340}, 50, 30, draw.Color{255, 200, 50, 255}, rotation = spin_angle)
|
||||
|
||||
// Circle orbiting a point (moon orbiting planet)
|
||||
// Convention B: center = pivot point (planet), origin = offset from moon center to pivot.
|
||||
// Moon's visual center at rotation=0: planet_pos - origin = (100, 450) - (0, 40) = (100, 410).
|
||||
planet_pos := draw.Vec2{100, 450}
|
||||
draw.circle(base_layer, planet_pos, 8, {200, 200, 200, 255}) // planet (stationary)
|
||||
draw.circle(base_layer, planet_pos, 8, draw.Color{200, 200, 200, 255}) // planet (stationary)
|
||||
draw.circle(
|
||||
base_layer,
|
||||
planet_pos,
|
||||
5,
|
||||
{100, 150, 255, 255},
|
||||
draw.Color{100, 150, 255, 255},
|
||||
origin = draw.Vec2{0, 40},
|
||||
rotation = spin_angle,
|
||||
) // moon orbiting
|
||||
@@ -101,7 +100,7 @@ hellope_shapes :: proc() {
|
||||
draw.Vec2{250, 450},
|
||||
0,
|
||||
30,
|
||||
{100, 100, 220, 255},
|
||||
draw.Color{100, 100, 220, 255},
|
||||
start_angle = 0,
|
||||
end_angle = 270,
|
||||
rotation = spin_angle,
|
||||
@@ -127,7 +126,7 @@ hellope_shapes :: proc() {
|
||||
{460, 450},
|
||||
6,
|
||||
30,
|
||||
{180, 100, 220, 255},
|
||||
draw.Color{180, 100, 220, 255},
|
||||
outline_color = draw.WHITE,
|
||||
outline_width = 2,
|
||||
rotation = spin_angle,
|
||||
@@ -190,14 +189,7 @@ hellope_text :: proc() {
|
||||
)
|
||||
|
||||
// Uncached text (no id) — created and destroyed each frame, simplest usage
|
||||
draw.text(
|
||||
base_layer,
|
||||
"Top-left anchored",
|
||||
{20, 450},
|
||||
PLEX_SANS_REGULAR,
|
||||
FONT_SIZE,
|
||||
color = draw.WHITE,
|
||||
)
|
||||
draw.text(base_layer, "Top-left anchored", {20, 450}, PLEX_SANS_REGULAR, FONT_SIZE, color = draw.WHITE)
|
||||
|
||||
// Measure text for manual layout
|
||||
size := draw.measure_text("Measured!", PLEX_SANS_REGULAR, FONT_SIZE)
|
||||
|
||||
Reference in New Issue
Block a user