hello, i currently have a counter set in the middle of the screen. How do i make it that it always stays in the middle of the screen since when the counter gets to 10 or something it gets bigger and goes out of position.
Thanks Lucas
Printable View
hello, i currently have a counter set in the middle of the screen. How do i make it that it always stays in the middle of the screen since when the counter gets to 10 or something it gets bigger and goes out of position.
Thanks Lucas
You could send your counter value to a string and then centre the string to the middle of the screen.
I did used this to code centre a sting perfectly in the middle
Set X Position to :
( Frame Width / 2 ) + ( OWidth( "Name of String counter" ) / 2 - OWidth( "Name of String counter" ) )
hope it helps :)
Oh it even works for counters just learnt something new
set x position to
( Frame Width / 2 ) + ( OWidth( "Counter name" ) / 2 )
Perfect results.
It tend to use strings because counters look ugly when they are resized, and if you turn counters to text you don't have as much control over how they are justified.
thanks
actually no it doesnt work since its hot spot is in the top left and you cant change that
Here's an example, if it's not what your after, explain what you need and I might be able to help.
Attachment 13629
you can use strings:
Attachment 13630
As I said above, strings look cleaner when resized. I was just going to add an another example yet, you beat me to the punch.
If you want to ensure it's always centred, for example when created on command. Use my code. It looks like you just centred the string to the middle of the frame manually, which works well mind you. For what it's worth here's my example.
Attachment 13631
hello, is there anyway i can give you the file to see the problem? i have tried what you said and it just doesn't go in the centre
If you set a counter to text, it always starts the right and adds value to the left. So your right, there's not much you can do to keep it centred as it increases. Unless you want a list of events that adjusts your counters x position depending on the amount of numbers.
Easiest solution is to send your counters value to a string, it takes one line of code. Good thing about strings is that you can set a string up to centre its text. I adjusted your file, trust me it's the best way to do it.
Attachment 13633
thanks
here is how you center something always center of the screen
http://community.clickteam.com/threads/87388-Always-center-of-the-screen
http://sparckmanforums.weebly.com/up...25426_orig.jpg