Color member functions
This commit is contained in:
parent
2578dceb42
commit
9e908b3925
6 changed files with 92 additions and 4 deletions
|
|
@ -105,7 +105,7 @@ pub fn main() anyerror!void {
|
|||
rl.drawRectangle(screenWidth - 5, 5, 5, screenHeight - 10, rl.Color.red);
|
||||
rl.drawRectangle(0, screenHeight - 5, screenWidth, 5, rl.Color.red);
|
||||
|
||||
rl.drawRectangle(10, 10, 250, 113, rl.fade(rl.Color.sky_blue, 0.5));
|
||||
rl.drawRectangle(10, 10, 250, 113, rl.Color.sky_blue.fade(0.5));
|
||||
rl.drawRectangleLines(10, 10, 250, 113, rl.Color.blue);
|
||||
|
||||
rl.drawText("Free 2d camera controls:", 20, 20, 10, rl.Color.black);
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ pub fn main() anyerror!void {
|
|||
|
||||
camera.end();
|
||||
|
||||
rl.drawRectangle(10, 10, 220, 70, rl.fade(rl.Color.sky_blue, 0.5));
|
||||
rl.drawRectangle(10, 10, 220, 70, rl.Color.sky_blue.fade(0.5));
|
||||
rl.drawRectangleLines(10, 10, 220, 70, rl.Color.blue);
|
||||
|
||||
rl.drawText("First person camera default controls:", 20, 20, 10, rl.Color.black);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ pub fn main() anyerror!void {
|
|||
|
||||
rl.initWindow(screenWidth, screenHeight, "raylib [shaders] example - Apply an outline to a texture");
|
||||
|
||||
const texture: rl.Texture2D = rl.loadTexture("resources/textures/fudesumi.png");
|
||||
const texture: rl.Texture = rl.Texture.init("resources/textures/fudesumi.png");
|
||||
|
||||
const shdrOutline: rl.Shader = rl.loadShader(null, "resources/shaders/glsl330/outline.fs");
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ pub fn main() anyerror!void {
|
|||
rl.initWindow(screenWidth, screenHeight, "raylib [texture] example - sprite anim");
|
||||
|
||||
// NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required)
|
||||
const scarfy: rl.Texture2D = rl.loadTexture("resources/textures/scarfy.png"); // Texture loading
|
||||
const scarfy: rl.Texture = rl.Texture.init("resources/textures/scarfy.png"); // Texture loading
|
||||
|
||||
const position = rl.Vector2.init(350.0, 280.0);
|
||||
var frameRec = rl.Rectangle{ .x = 0.0, .y = 0.0, .width = @intToFloat(f32, @divFloor(scarfy.width, 6)), .height = @intToFloat(f32, scarfy.height) };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue