Issues with drawing text

Faeles

  • Posts: 4
Hi, I downloaded Stencyl earlier today and have ran into an issue, I'm trying to have the game draw text over an NPC if you try to talk to him, but that block of code is greyed(redded?) out, and attempting to run the game instantly crashes it with the error being located at that exact function, anyone know why? It's a level event if that helps at all, thanks.

JeffreyDriver

  • *
  • Posts: 2151
Drawing blocks can only be placed in a drawing event.
Current Projects:
The Grand Grimoire Chronicles Episode 1 now on Kongregate!.
I always appreciate useful feedback. Thank you.
www.jeffreydriver.co.uk

Faeles

  • Posts: 4
Drawing blocks can only be placed in a drawing event.
Thank you. It's still not visible despite me specifying the font, color and which layer it should be on but at least it's not crashing anymore.

JeffreyDriver

  • *
  • Posts: 2151
Can you post your code of the drawing event?
Current Projects:
The Grand Grimoire Chronicles Episode 1 now on Kongregate!.
I always appreciate useful feedback. Thank you.
www.jeffreydriver.co.uk

Faeles

  • Posts: 4
Can you post your code of the drawing event?
Sure, this is what I have atm, I thought I'd worry about the placement later so now I'm trying to make the text appear on the top layer with no parallaxing.
https://imgur.com/a/a4Njoir

grmata

  • *
  • Posts: 64
Are trying to draw the text in a Scene behavior or an Actor behavior?

Try testing the text drawing without all the conditions. Then you can narrow down the problem.

Remember if the drawing is being done from an actor the xcord and ycord start from where ever the actor is and not the 0,0 cord of the camera.

Faeles

  • Posts: 4
Are trying to draw the text in a Scene behavior or an Actor behavior?

Try testing the text drawing without all the conditions. Then you can narrow down the problem.

Remember if the drawing is being done from an actor the xcord and ycord start from where ever the actor is and not the 0,0 cord of the camera.
A scene behaviour, and I'm trying to just get it to actually draw first before worrying about where it goes.

How I want it to work is:

player gets close to an NPC by entering a region(working)
player presses a button (working on other functions)
dialogue text appears above the NPCs head, or on the screen at all (not working)

grmata

  • *
  • Posts: 64
For now just set the font and draw the text.
Also draw a lot more test text so you can see where it is popping up.
Mess with the cords until it shows up on screen.
Then add the rest.