LineXY needs 3D???
LineXY needs 3D???
Why is using LineXY() causing PB to crash out, telling me I need to use InitEngine3D()?? It's a 2D drawing command in the 2D drawing index.
Re: LineXY needs 3D???
I guess it will remain a mystery. I managed to draw the lines I wanted with zoomed sprites and a bunch of fancy math to rotate them. Heck of a workaround.
Re: LineXY needs 3D???
LineXY() doesn't need 3D, please post a code
Re: LineXY needs 3D???
Here's the code that caused the issue.
Code: Select all
Procedure Screen_Game()
DrawToGame()
DrawingMode(#PB_2DDrawing_Default)
Protected InFrame.a
Protected LensX.w, LensY.w
Protected DustIntense.w
Protected DustR.a, DustG.a, DustB.a
Protected TurClipX.a, TurClipY.a DustOpacity = 0.0
Select GameRezSize
Case 0 : Box(CornerX, CornerY, 1280, 720, RGB(0, 0, 0))
Case 1 : Box(CornerX, CornerY, 1920, 1080, RGB(0, 0, 0))
EndSelect
LineXY(NodeX(0), NodeY(0), NodeX(0), 720, RGB(160, 160, 160))
EndDrawing()Re: LineXY needs 3D???
I discovered what the problem was... I was not using the proper variable name. The NodeX was inside a structure, and when I changed it to this it worked:
For some reason the error reported was not that the variable doesn't exist, but 3D was required.
Code: Select all
LineXY(Rope\NodeX(0), Rope\NodeY(0), Rope\NodeX(0), 720, RGB(160, 160, 160))-
Little John
- Addict

- Posts: 4807
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: LineXY needs 3D???
We cannot reproduce that, as the code you posted to show the issue is not executable.Carm3D wrote: Mon Oct 27, 2025 11:25 pm For some reason the error reported was not that the variable doesn't exist, but 3D was required.
Perhaps using ‘EnableExplicit’ in your code would have helped.
Re: LineXY needs 3D???
It's because NodeX() and NodeY() are 3D functions. https://www.purebasic.com/documentation/node/nodex.htmlCarm3D wrote: Mon Oct 27, 2025 11:25 pm For some reason the error reported was not that the variable doesn't exist, but 3D was required.
The compiler was seeing the 3D functions within your LineXY call, which is why you where getting the InitEngine3D() error.
Re: LineXY needs 3D???
Ahhhhh! Brilliant.Samuel wrote: Tue Oct 28, 2025 1:49 amIt's because NodeX() and NodeY() are 3D functions. https://www.purebasic.com/documentation/node/nodex.html
The compiler was seeing the 3D functions within your LineXY call, which is why you where getting the InitEngine3D() error.

