Actor Identifier other than 'last created' and 'last collided'?

faile486

  • Posts: 15
It draws it, then everything disappears a second later. I need it to stay on screen for the entire scene.


faile486

  • Posts: 15
Those are all examples of things that are drawn every time the draw function is triggered.  I'm looking for a way to just create static text. Is there no way to do that?

JeffreyDriver

  • Posts: 2262
If you just set a text block under a drawing event it will remain on screen, and it won't disappear or change unless you make it.

faile486

  • Posts: 15
Right now I've got three list variables, Solution (which includes the entire puzzle solution), Given (which contains only the numbers shown at the start of the puzzle), and Input (which is updated throughout the puzzle with the player's input). If there was a way to make text permanent (I can't come up with another way to describe it), then I could eliminate the Given list and just print the initial iteration of the Input list instead.

Does that make sense?

KramerGames

  • Posts: 405
You could just use the input list and at the start of the game and fill it with only the numbers that are given. I would also make a boolean called "solution showing" which is set to false but can be set to true by the player. Then you could add a "when drawing" event in the actor behavior for the cell that looks something like that:

IF 'solution showing' = true
   draw text "get item 'id' from ' solution list' " at x and y

OTHERWISE IF "get item 'id' from 'input list' " > 0
  draw text "get item 'id' from 'input list' " at x and y


So now it checks if the solution should be displayed, if yes, it draws it and stops the rest of the code. If it's not showing it checks if the player has already input something, if yes, it draws that. I am assuming 0 can't be input by the player?
 


Edit: If you want text to be permanent you could use "labels", but that is somewhat more complicated and you don't really need that here.
Parasites United  (Idle Parasite Game)

VoidShard

  • Posts: 81
I don't have much time now, but if you want to do this very simply, check the attached image. Also look at the image API, it's very useful.