Displaying text in specific coordinates

Is there any way possible to have it so you can have an actor display text in a specific X and Y location WITHOUT having to make another object? I know you can do that it that way, but under the current circumstances, I can't do that without having a bunch of extra problems to deal with, and I don't really feel like explaining it. They really need to make that an option on here if this feature isn't possible yet.

Having trouble with your game? Sounds like a personal problem.

Comments

  • TokuharaTokuhara Member Posts: 94
    Just leave the actor with display text outside the scene and create a rule to change its position and text if something happens.

    Exemple (Text Actor with 2 rules inside):
    -----------------------------------------

    Rule - if attribute "move left" is "true"
    Display text: My text
    Change attribute self.position X to "any number"
    Change attribute self.position Y to "any number"

    -----------------------------------------

    Rule - if attribute "move right" is "true"
    Display text: My text 2
    Change attribute self.position X to "any number"
    Change attribute self.position Y to "any number"
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Yes remember an actor is an actor and can do anything any other actor can do. Just because you use it to display text as shown above you can adjust any attribute. Don't let your thought process be blocked by the GUI of GS. You have to learn to think in logic and see how creator programing works. It's all just arranging and changing variables around.
  • ADSentertainmentADSentertainment Member Posts: 397
    Yes remember an actor is an actor and can do anything any other actor can do. Just because you use it to display text as shown above you can adjust any attribute. Don't let your thought process be blocked by the GUI of GS. You have to learn to think in logic and see how creator programing works. It's all just arranging and changing variables around.
    Alright, I mean, the problem that was going on with me though was that the actor had an image, but I wanted text to show above it. And I wasn't able to think of any way possible to change the text's coordinates without changing the actor's coordinates without making a separate actor that displayed text that would follow another

    Having trouble with your game? Sounds like a personal problem.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    You need two actors for that. Some things have simple answers and this is one of them. Either have the image actor spawn the text actor at a relative position (e.g. 60 pixels above) or position it off-screen and move it into place as was already suggested.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • ADSentertainmentADSentertainment Member Posts: 397
    You need two actors for that. Some things have simple answers and this is one of them. Either have the image actor spawn the text actor at a relative position (e.g. 60 pixels above) or position it off-screen and move it into place as was already suggested.
    :/ darn, under the circumstances, I need them to be the same actor.

    Having trouble with your game? Sounds like a personal problem.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I take it you're wanting something like a lives/score/name display over each moving actor. The only way I know to do that is by constraining one actor to another. This demo should help: https://forums.gamesalad.com/discussion/comment/384027/#Comment_384027.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • ADSentertainmentADSentertainment Member Posts: 397
    I take it you're wanting something like a lives/score/name display over each moving actor. The only way I know to do that is by constraining one actor to another. This demo should help: https://forums.gamesalad.com/discussion/comment/384027/#Comment_384027.
    What I'm trying to do is have several actors display text showing a local attribute to that actor, but show it above the actor and not right smack in the middle of it. I can't constrain a global variable to it however because I wouldn't think a global variable would be constrained to only one of the actor's local attributes (?)

    Having trouble with your game? Sounds like a personal problem.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    You can if you want to. Here are the two demos I made modified to display the text value of each actor's health. You could use actual text (e.g. a word) instead of numbers and it would work the same way. You just have to set a static value for the width of the health bar actor rather than constraining it to the health attribute as I've done.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • TokuharaTokuhara Member Posts: 94
    You can constrain a local attribute to a global attribute.
    For example you can constrain your actor's local score attribute to a global attribute:

    Actor
    Constrain attribute game.score to self.score

    I made an example, don't know if its what you are trying to do...

  • ADSentertainmentADSentertainment Member Posts: 397
    You can constrain a local attribute to a global attribute.
    For example you can constrain your actor's local score attribute to a global attribute:

    Actor
    Constrain attribute game.score to self.score

    I made an example, don't know if its what you are trying to do...

    Oh, I know that, but what if I had several of those actors that have that behavior, can a single global attribute be equal to each individual attribute of each actor?

    Having trouble with your game? Sounds like a personal problem.

  • TokuharaTokuhara Member Posts: 94
    You can only store one local attribute in one global attribute...
    What you can do to not create a global attribute for each local attribute is store all in one table.
  • ADSentertainmentADSentertainment Member Posts: 397
    You can only store one local attribute in one global attribute...
    What you can do to not create a global attribute for each local attribute is store all in one table.
    I'm still a tad new to tables.

    Having trouble with your game? Sounds like a personal problem.

  • Yovanny369Yovanny369 Member Posts: 105
    Not sure if this is what you want but this is how I display multiple text in different positions.

    https://www.dropbox.com/sh/9gqiviyqfbjs7xz/Me9jyf_C3_
  • BBEnkBBEnk Member Posts: 1,764
    not sure if your actor is active but if its just for display you could make it taller and have image below and transparent above so text in middle is above image.
  • ADSentertainmentADSentertainment Member Posts: 397
    Not sure if this is what you want but this is how I display multiple text in different positions.

    https://www.dropbox.com/sh/9gqiviyqfbjs7xz/Me9jyf_C3_
    That's actually really clever, that can probably fix my solution very easily. Thank you! I appreciate it :)

    Having trouble with your game? Sounds like a personal problem.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Nicely done, @Eduard0369. A much simpler solution than mine. And if you don't need the bottom text, you can just leave it as "Up"..self.U/D

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Yovanny369Yovanny369 Member Posts: 105
    @ADSentertainment
    @tatiang
    Thanks guys! I like that you have found this usuable!
    but also you can display special characters as icons, symbols, etc.
    look at this example
    https://www.dropbox.com/sh/9gqiviyqfbjs7xz/Me9jyf_C3_
  • BBEnkBBEnk Member Posts: 1,764
    @Eduard0369

    Hey @Eduard0369 how are you putting the space between the up and down I see how it works but can only space them left and right once I make my own.
  • Yovanny369Yovanny369 Member Posts: 105
    @BBEnk
    With the option key and enter.
  • ADSentertainmentADSentertainment Member Posts: 397
    @BBEnk
    With the option key and enter.
    Ooh, that's helpful for a lot of other things too

    Having trouble with your game? Sounds like a personal problem.

  • BBEnkBBEnk Member Posts: 1,764
    @BBEnk
    With the option key and enter.
    Thanks I tried every combination but that one.

Sign In or Register to comment.