Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot accept floating point to integer functions #55

Open
iacore opened this issue Dec 23, 2023 · 1 comment
Open

cannot accept floating point to integer functions #55

iacore opened this issue Dec 23, 2023 · 1 comment

Comments

@iacore
Copy link

iacore commented Dec 23, 2023

true code:

        (pp nearest-vertex)
        (draw-circle-gradient (splice nearest-vertex) 4.0 :lime :red))))
(264.160827636719 400)
error: bad slot #0, expected 32 bit signed integer, got 264.160827636719
  in jaylib/draw-circle-gradient
  in _thunk [main.janet] (tailcall) on line 42, column 9

Reproduction

(draw-circle-gradient [264.160827636719 400] 4.0 :lime :red)
@sogaiu
Copy link

sogaiu commented Dec 24, 2023

Perhaps this is the current implementation for draw-circle-gradient. It looks like there is an underlying Raylib function named DrawCircleGradient.

Looking at this raylib cheatsheet, I see:

void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2);       // Draw a gradient-filled circle

It looks like DrawCircleGradient wants the first 2 arguments to be of type int and currently the way those are arranged for is to use janet_getinteger.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants