Skip to content

How to update raylib on tag add/remove #45

@Shadowblitz16

Description

@Shadowblitz16

This is how I was updating my rectangle...

    private static void UpdateRectangle(Local<Rectangle> previous, Query<Data<Rectangle>, Filter<With<Window>>> query)
    {
        foreach (var item in query)
        {
            if (Raylib.IsWindowReady())
            {
                item.Deconstruct(out var rectangle);
                if (previous.Value != rectangle.Ref)
                {
                    previous.Value = rectangle.Ref;
                    Raylib.SetWindowPosition(rectangle.Ref.X, rectangle.Ref.Y);
                    Raylib.SetWindowSize((int)rectangle.Ref.Width, (int)rectangle.Ref.Height);
                }
                
                var raylibRectangle = new Rectangle((int)Raylib.GetWindowPosition().X, (int)Raylib.GetWindowPosition().Y, (uint)Raylib.GetScreenWidth(), (uint)Raylib.GetScreenHeight());
                if (previous.Value != raylibRectangle)
                {
                    previous.Value = raylibRectangle;
                    rectangle.Ref  = raylibRectangle;
                }
            }
        }
    }

But I have a empty Minimized, Maximized, and Fullscreen empty readonly record struct which I want to use for syncing state...

public readonly record struct Fullscreen();
public readonly record struct Maximized();
public readonly record struct Minimized();

I want to do something when these are added and removed from a entity if it has a window tag.
How do I do this?

Your State example in your readme is outdated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions