foreignsasquatch / raylib-hx

Haxe bindings for raylib, a simple and easy-to-use library to learn videogame programming
https://raylib.com
zlib License
55 stars 13 forks source link

'w' is not a member of Rectangle #15

Closed Caresle closed 2 years ago

Caresle commented 2 years ago

Hello, when i'm trying to create a Rectangle and then draw on screen, I get this error when i compile.

Here is the code i'm using.

import Raylib.Rectangle;
import Raylib.Colors;
import Raylib.*;

class Main
{
    static function main()
    {
        var screenWidth = 800;
        var screenHeight = 450;
        InitWindow(screenWidth, screenHeight, "Draw a rectangle");
        SetTargetFPS(60);

        var rect = Rectangle.create(100, 100, 36, 36);
        while(!WindowShouldClose())
        {

            BeginDrawing();
                DrawRectangle(Std.int(rect.x), Std.int(rect.y), Std.int(rect.w), Std.int(rect.h), Colors.RED);
            EndDrawing();
        }

        CloseWindow();
    }
}
foreignsasquatch commented 2 years ago

The w and the h variables of rectangle must be replaced as they are called width and height in raylib.h. This will be fixed shortly :)