Hello,
I’m trying, as an old pet project, to do a 4x game in space (think Master of Orion).
On the screen, there is Stars : Instancied objects each with CollisionObject, Script and Sprite.
Can be 100+ of these stars, all created by a Factory.
Each Star has it’s own personality (one of seven sprites, position, ID…).
No problem here : I have a beautiful multicolored starfield.
The starfield is bigger than the screen. But I worked a little (two days), and now the starfield move with the cursor keys (well, It move an Ortho camera, but still).
I added Zoom. Had to understand you can’t put negative as zoom, that’s 0.x value is for. But now I can zoom in and out and move my starfield as I want.
Neat.
So much easier that Godot !
And then, and then… Why can’t I click on my stars ?
I can’t have more that 16 input focus, when I can have dozens of star objects on the screen.
Trying to Touch the star with the mouse don’t work, since the star’s object can’t listen inputs, and the machine cursor don’t have CollisionObject.
Created an Object called “Cursor”, added it a Collision Object, and make it in his update function to change it’s position for the “machine” cursor.
But between the lag and the fact I can’t understand how to translate Screen and World coordinates in each other, particularly with the camera moving and zooming, nothing work.
I looked at some “3rd parties” scripts, but I’m not really sure of how it works.
I tried to look at that “input manager” thing, but Im’ sure… I understand nothing (well, there is not a lot of doc on that, apparently).
I read Gui objects can be clicked, then I think trying to put some invisible GUI button on top of each star (with the Screen position). I didn’t try the GUI part of Defold, then I don’t know if that’s possible.
Worked all day on it, but I’m stuck.
Is it really not possible ?