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

CanvasItem drawPolygon NilAccess #26

Closed
rafallus opened this issue May 23, 2018 · 3 comments
Closed

CanvasItem drawPolygon NilAccess #26

rafallus opened this issue May 23, 2018 · 3 comments

Comments

@rafallus
Copy link
Contributor

rafallus commented May 23, 2018

While trying to draw a polygon with the drawPolygon or drawColoredPolygon functions of a CanvasItem node, I get the following error

ERROR: : Unhandled Nim exception (NilAccessError):
godotmacros.nim(569)     methFunc
map2D.nim(57)            draw
canvas_item.nim(797)     drawPolygon
godotnim.nim(433)        godotObject

I'm using the function as follow:

drawPolygon(points, colors, newPoolVector2Array())

I think the problem is I'm using the default value of the texture which is nil, and the code tries to pass this nil texture as a godot object:

proc drawPolygon(self: CanvasItem; points: PoolVector2Array; colors: PoolColorArray;
                uvs: PoolVector2Array; texture: Texture = nil;
                normalMap: Texture = nil; antialiased: bool = false) =
...
let argToPassToGodot3 = texture.godotObject # <= This is the line 797 of canvas_item.nim

Am I supposed to pass a not nil texture for this to work? I just want to draw a filled polygon with plain color.

@rafallus rafallus changed the title CanvasItem drawPolygon NilAcces CanvasItem drawPolygon NilAccess May 23, 2018
endragor added a commit that referenced this issue Jun 4, 2018
@rafallus
Copy link
Contributor Author

Still not working for me. I have the same error despite the changes. I'm using version 0.7.13

@endragor
Copy link
Member

You need to re-generate the Godot API wrappers. If your project is based on the stub, do nake clean, then nake build.

@rafallus
Copy link
Contributor Author

Thanks, was that, I didn't make a proper cleaning

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