Is there a way to get the Display Text to stay on the screen?
I'm using a When Touch is Pressed rule, along with a Display Text with a tableCellValue(Table, Random(1,6),1) rule.
@DocJ said:
Is there a way to get the Display Text to stay on the screen?
I'm using a When Touch is Pressed rule, along with a Display Text with a tableCellValue(Table, Random(1,6),1) rule.
Why is it currently not staying on the screen? If you use "position relative to scene", it should be visible at all times unless one of two things happens:
The actor displaying it is destroyed
Another actor is on a higher layer, blocking it from view
I'm using a PC and don't have the positioning options as in the Display Text on a Mac. I am trying to create a 6-sided dice that shows words instead of numbers. I'm using the Touch is Pressed rule along with Display Text. When I Touch the Actor on scene, it will show one of the rows from the 6 row table that I'm using, but as soon as let go of the Touch, the word goes away too.
I'm new to this, but I was thinking I might need a Boolean to somehow tell GS to consider the Actor still being Pressed until the final dice is pressed.
Yes, that's exactly right. Have a boolean that's turned to "true" when touch is pressed. Then put the display text in a rule that checks for when the boolean is "true".
If you want to use a game level attribute followed by a space and then a word, how would you do that? When I try typing a space it won't let me. I have the attribute with the word right next to it so I'm just missing the space in between.
@dreichelt said:
If you want to use a game level attribute followed by a space and then a word, how would you do that? When I try typing a space it won't let me. I have the attribute with the word right next to it so I'm just missing the space in between.
game.Attribute.." word"
You need to alt-Space for the space though, as noted in the guide.
@Armelline I am trying to combine the sum of two game level attributes for display. When I click the actor on my screen you get a point for the manual click but you can also get points over time. So basically like cookie clicker. However when I used the two dots to combine two attributes it didn't add the sum of the two integers it just put them side by side.
So for example, my current point per click is 1 and my current points automatically per second is 0. But when I put those into the text display it shows 10 instead of 1 since 1+0 = 1. I was wondering if you could tell me how to fix this?
@Armelline When I display my score/highscore attribute it only shows one "0" but I want to start countting like so "00000" instead of "0". Is this possible?
@UncloudedStudio said: @Armelline When I display my score/highscore attribute it only shows one "0" but I want to start countting like so "00000" instead of "0". Is this possible?
Display it as: padInt(score attribute,5)
This will pad out the score with a minimum of 5 digits, so for example padInt(56,5) will give you 00056 . . . . or padInt(220,7) will give you 0000220 . . . etc.
Also having a problem I just can't seem to find/fix. I have an actor that displays the highscore. It's in a menu and when I interpolate it offscreen for a few times (clicking back an forth in the menus) the highscore disappears. Seems to happen totally at random.
Also having a problem I just can't seem to find/fix. I have an actor that displays the highscore. It's in a menu and when I interpolate it offscreen for a few times (clicking back an forth in the menus) the highscore disappears. Seems to happen totally at random.
There is probably an error in your code/logic. Maybe start another thread, don't want drag @Armelline's thread too off course.
@UncloudedStudio How far do you move it off screen? Is the actor getting destroyed? It's normally the actor getting destroyed when it comes to that kind of thing. If not, then @Socks is probably right and it's probably an error in your logic somewhere.
If you assign the display text to the square actor, how do you make the square invisible... I turned invisibility off but then the text disappears too!?
@bkhoward2001 said:
If you assign the display text to the square actor, how do you make the square invisible... I turned invisibility off but then the text disappears too!?
@Armelline I can't seem to get the line break to work on the display text... I have tried alt+Enter but that does not seem to work on windows.... Any idea without me having to add the \n in the editor itself?
Comments
Absolutely - check the section on concatenation near the end. You combine strings etc. with two dots - ..
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Oh I missed that, my bad. Appreciate it and keep up the great tutorials.
Is there a way to get the Display Text to stay on the screen?
I'm using a When Touch is Pressed rule, along with a Display Text with a tableCellValue(Table, Random(1,6),1) rule.
Why is it currently not staying on the screen? If you use "position relative to scene", it should be visible at all times unless one of two things happens:
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
@Armelline I missed this post, looks really good and very detailed:)!
I'm using a PC and don't have the positioning options as in the Display Text on a Mac. I am trying to create a 6-sided dice that shows words instead of numbers. I'm using the Touch is Pressed rule along with Display Text. When I Touch the Actor on scene, it will show one of the rows from the 6 row table that I'm using, but as soon as let go of the Touch, the word goes away too.
I'm new to this, but I was thinking I might need a Boolean to somehow tell GS to consider the Actor still being Pressed until the final dice is pressed.
Yes, that's exactly right. Have a boolean that's turned to "true" when touch is pressed. Then put the display text in a rule that checks for when the boolean is "true".
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
If you want to use a game level attribute followed by a space and then a word, how would you do that? When I try typing a space it won't let me. I have the attribute with the word right next to it so I'm just missing the space in between.
game.Attribute.." word"
You need to alt-Space for the space though, as noted in the guide.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Thank you!
@Armelline Great Tutorial! Thank you for making this! So helpful
@Armelline Awesome post..thank for sharing..do you have pdf of this, to refer when we are in offline
Thanks
No immediate plans to do so but if you are on a Mac you can print any web page as a PDF.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
@Armelline I am trying to combine the sum of two game level attributes for display. When I click the actor on my screen you get a point for the manual click but you can also get points over time. So basically like cookie clicker. However when I used the two dots to combine two attributes it didn't add the sum of the two integers it just put them side by side.
So for example, my current point per click is 1 and my current points automatically per second is 0. But when I put those into the text display it shows 10 instead of 1 since 1+0 = 1. I was wondering if you could tell me how to fix this?
Use + not .. to add numbers. The double period concatenates the two items, whereas + will add them.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Ah of course! Thank you for that!
@Armelline,
Thanks for the helpful post. I'd like to revive the thread to add the following (which
just occurred to me):
If you need to use a combination of text, a line break, and a variable, type the following in the expression editor:
You can see the text and line break go inside the quotes. Then you concatenate it with the double period, then you add the variable.
My Blog / App Store / Google Play
@Armelline When I display my score/highscore attribute it only shows one "0" but I want to start countting like so "00000" instead of "0". Is this possible?
Display it as: padInt(score attribute,5)
This will pad out the score with a minimum of 5 digits, so for example padInt(56,5) will give you 00056 . . . . or padInt(220,7) will give you 0000220 . . . etc.
@Socks Great, thank you!
Note: lower case 'p' and capital 'I' on 'padInt'.
Works Perfect!
Also having a problem I just can't seem to find/fix. I have an actor that displays the highscore. It's in a menu and when I interpolate it offscreen for a few times (clicking back an forth in the menus) the highscore disappears. Seems to happen totally at random.
There is probably an error in your code/logic. Maybe start another thread, don't want drag @Armelline's thread too off course.
@socks Yes, that's maybe better.
@UncloudedStudio How far do you move it off screen? Is the actor getting destroyed? It's normally the actor getting destroyed when it comes to that kind of thing. If not, then @Socks is probably right and it's probably an error in your logic somewhere.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
If you assign the display text to the square actor, how do you make the square invisible... I turned invisibility off but then the text disappears too!?
Set the actor's Color>Alpha to 0.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
@Armelline I can't seem to get the line break to work on the display text... I have tried alt+Enter but that does not seem to work on windows.... Any idea without me having to add the \n in the editor itself?
Is it possible to display 2 different attributes separately within 1 display text behaviour?
yes. need to make sure you separate them and any text with ..
eg
“score: “..attribute1..” time: “..attribute2