The Daily Click ::. Forums ::. Klik Coding Help ::. Centralizing a alterable string object
 

Post Reply  Post Oekaki 
 

Posted By Message

Dave S.



Registered
  26/09/2003
Points
  924
12th February, 2007 at 10:58:04 -

Basically, the user would input a level title which would then be centralised upon the X axis. I tried using a calculation in the expression editor but LEN is the number of characters and not pixels.

 
n/a

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
12th February, 2007 at 11:05:02 -

I dunno. I don't think you can get the width of a String/Text object anyway. But if you're using MMF, you can use an Active System Box or something...

 
n/a

X_Sheep

I had a custom rating before it was cool

Registered
  01/03/2004
Points
  1313

VIP MemberPicture Me This -Round 23- Winner!Dos Rules!
12th February, 2007 at 11:15:21 -

You want the String object to be centralized, or the Edit object?

 
a/n

Dave S.



Registered
  26/09/2003
Points
  924
12th February, 2007 at 11:24:19 -

The user is prompted for a level name, eg; 'My level'. I then want the text (string) to be centralized along the width of the screen (X axis).

 
n/a

Dave S.



Registered
  26/09/2003
Points
  924
12th February, 2007 at 11:27:32 -

Axel... just looked at the 'active system box' extension. I may be able to use it.

 
n/a

David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
12th February, 2007 at 12:24:07 -

I don't think you can do it from the Event Editor easily, but to do it via the Frame Editor, stretch the width of the String object across your whole window and set its alignment to Center.

 
http://www.davidn.co.nr - Games, music, living in America

Dave S.



Registered
  26/09/2003
Points
  924
12th February, 2007 at 12:33:02 -

Wong... I tried that but it doesn't move the type within the box. Only the box itself moves!

 
n/a

X_Sheep

I had a custom rating before it was cool

Registered
  01/03/2004
Points
  1313

VIP MemberPicture Me This -Round 23- Winner!Dos Rules!
12th February, 2007 at 12:40:19 -

Select the String object, click "Text" in the menu bar, then click Align, then Center Horizontally.

 
a/n

David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
12th February, 2007 at 12:40:47 -

The alignment in the Properties, not the alignment in the frame. (In Properties if you're in MMF2, or in the mad location of the menu bar's Text menu in 1.5.)

 
http://www.davidn.co.nr - Games, music, living in America

Dave S.



Registered
  26/09/2003
Points
  924
12th February, 2007 at 13:43:55 -

Hooray it worked... I can't believe that's all I had to do, cheers men.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click