Well, you're both pointing out the problem and the answer slightly yourself :V
You're using a regular render function to mutate a 3D sprite object. The coordinates of a 3D sprite are based on the XYZ of the danmakufu 3D space and the 2D sprites are based on the game field,
except when you set the Layer 80+
(or 0.8 if you're using the regular one), which then the entire window of the program become the coordinates. To clarify:
Let us say your game field is
X: 200 and Y: 400. You decide to centre your boss using your own
GetCenterX / GetCenterY code
(Which is field / 2). The boss X,Y position is
100,200. Imagine we try to draw a texture/sprite on
Layer 80 using the same functions. We have to keep in mind that our Danmakufu window is by default
640x480. Drawing our texture and giving the
GetCenterX/Y will put it at
320,240. Because after all, that is the centre of the whole window. Obviously this won't align with the boss, as they are calculating their coordinates differently. But what if we put our texture on
Layer 30? Suddenly, it will align proper, as both are calculating the centre based on the play field.
The same story goes for 3D, except more complicated when you're involving the camera. First of all, 3D coordinates of danmakufu are fixed. If you put something at
0,0,0 in 3D space and you put your camera
-256 on the X-axis, your sprite will be off-centre for you, but in terms of code it is still located
0,0,0.
TL DR: You don't want to mix 2D ad 3D to align things because generally it will be a hassle regardless.
Is it an aesthetic thing you wish to put your magic circle in 3D? The 2D sprite allows X Y Z angling as well. Or you think that looks a bit too "thin paper"?
Alternative solution I can offer you is a Mesh object. Because it takes the function:
ObjMesh_SetCoordinate2D(obj,boolean); http://dmf.shrinemaiden.org/wiki/Mesh_Object_Functions#ObjMesh_SetCoordinate2D which then allows you to use 2D coordinates. Had similar issue with my Tewi Mochi hammer in my game. So what you need to do is:
- Make a flat mesh object in a 3D modelling program.
- Texture it with the magic circle
- Summon it in your script using the mesh functons
- Set the
ObjMesh_SetCoordinate2D to true.
- Continue further using regular
ObjRender functions.
Either use 2D sprite and angle it X Y Z giving it that "3D-ish" feeling. Or use the Mesh trick.
Edit note: explaining more added to original post.