Gizmo199 / fauxton3D

A 2.5d Sprite-Stacking engine for Game Maker Studio 2
Other
44 stars 3 forks source link

Drawing hover text #5

Open ipl-adm opened 2 years ago

ipl-adm commented 2 years ago

Hello! Could you please suggest how you can draw text over an object that would look in the direction of the camera? The draw_text method did not help solve the problem. Maybe I'm misunderstanding something?

colmeye commented 2 years ago

draw_text is a function that will draw in the normal 2D orientation of GameMaker. If you want to translate/rotate it in a 3D space you'll need to use a matrix transform like so

matrix_set(matrix_world, matrix_build(x, y, z, 90, Camera.Angle + 270, 0, 1, 1, 1));
    draw_text(0, 0, "text");
matrix_set(matrix_world, matrix_build_identity());

You should check out Dragonite's video on matrix transforms https://www.youtube.com/watch?v=IeoAzmFdu6k

ipl-adm commented 2 years ago

Thanks for references! Also, how i can enable text smoothing? Because text so pixelized. I tryed to use draw_text_transformed, but still no effect.

colmeye commented 2 years ago

There are a few ways you could improve it, depending on your game and font. I'd recommend joining the GameMaker discord server and asking in the help channels there. These questions are more GM related rather than issues with fauxton https://discord.gg/gamemaker