User Tag List

Results 1 to 9 of 9

Thread: Change the hotspot of a string object?

  1. #1
    Clicker Fusion 2.5 DeveloperiOS Export Module
    ChrisBurrows's Avatar
    Join Date
    May 2011
    Location
    Tasmania, Australia
    Posts
    622
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Change the hotspot of a string object?

    Hello,

    Has anybody figured a way to change the "hotspot" position of a string object?

    For example, say you have a string object, 100 pixels wide and with centred horizontal alignment. You want this string object to be positioned above your player. So you set the X position of your string to the X position of your player. The problem is, even though your string has centre alignment, it will not appear at the centre of your player because the hotspot of string objects is at their top left corner. This is not the centre of your text.
    Attached files Attached files

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    oruga's Avatar
    Join Date
    Feb 2012
    Posts
    366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can't, but you don't have to align it exactly to the object's hotspot. Adjust it to be centered. if your string object is 100 pixels wide just set its x position to the x position of your player - 50. That works just fine.

  3. #3
    Clicker Fusion 2.5 DeveloperiOS Export Module
    ChrisBurrows's Avatar
    Join Date
    May 2011
    Location
    Tasmania, Australia
    Posts
    622
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Not if you don't know long your string is going to be because you are allowing your player to pick their own name of whatever length they please...

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    KLiK-iT's Avatar
    Join Date
    Sep 2011
    Location
    New Jersey
    Posts
    2,852
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Chris,.I don't use string objects much,.but is there a way that MMF can detect the character length of a string? If so you could move it according to length. Or maybe use detectors and set them above the character and if the string is over lapping the detectors move the string left or right.

  5. #5
    Clicker Fusion 2.5 DeveloperiOS Export Module
    ChrisBurrows's Avatar
    Join Date
    May 2011
    Location
    Tasmania, Australia
    Posts
    622
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    You can retrieve the character length easily. But not the length in pixels. Characters like "m" are much bigger than a "." or a space. Collision detectors don't work because the collision mask is the area of the total string object, not the text of the object.

    Anybody?

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    oruga's Avatar
    Join Date
    Feb 2012
    Posts
    366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    O_O geez, just try what I told ya, it works good. You don't know the length but you set the width limit on the frame, when you set a string to be 100 pixels wide it means it cannot go beyond that if it is less it works just fine. If you are afraid it won't be enough you can set it to a crazy width like 800 or whatever, still works, try it.

  7. #7
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleXNA Export Module
    DistantJ's Avatar
    Join Date
    Jan 2008
    Location
    Gloucester, UK
    Posts
    2,144
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    You can find the width in pixels.

    "X co-ordinate of right edge" - "X co-ordinate of left edge"

  8. #8
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jul 2006
    Location
    USA
    Posts
    2,982
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by oruga View Post
    O_O geez, just try what I told ya, it works good. You don't know the length but you set the width limit on the frame, when you set a string to be 100 pixels wide it means it cannot go beyond that if it is less it works just fine. If you are afraid it won't be enough you can set it to a crazy width like 800 or whatever, still works, try it.
    This would work. If the string text is set to centered it won't matter how long or short it is. If you have it left aligned well then yeah you might have inconsistencies.

  9. #9
    Clicker Fusion 2.5 DeveloperiOS Export Module
    ChrisBurrows's Avatar
    Join Date
    May 2011
    Location
    Tasmania, Australia
    Posts
    622
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by DistantJ View Post
    You can find the width in pixels.

    "X co-ordinate of right edge" - "X co-ordinate of left edge"
    That just finds the edge co-ordinates of the objects collision mask, not from the first character to the last.


    Quote Originally Posted by oruga View Post
    You can find the width in pixels.

    " O_O geez, just try what I told ya, it works good. You don't know the length but you set the width limit on the frame, when you set a string to be 100 pixels wide it means it cannot go beyond that if it is less it works just fine. If you are afraid it won't be enough you can set it to a crazy width like 800 or whatever, still works, try it."
    I know what you mean and it does work in that situation but that isn't actually what I'm trying to do. I am creating a spreadsheet style array editor. The columns have adjustable widths. The column headings (1, 2 ,3 etc) are centred and it works fine. But.... I can either have it so it is centred for columns 1-9 and then 10 and above looks weird, or 1-9 look weird and 10 and above is centred correctly. At first, I thought being able to alter the strings hotspots would fix it, but now I think about it, I doubt it.

    But, this off centre centred text is only noticeable when you resize a column to its minimum width of 30 pixels and maybe I'll just have to live with that.

    http://www.whenthereisnoroominhellth...arrayordie.mfa (work in progress. glitchy as all hell.)

    Maybe you can think of something?

    I appreciate your help, both of you!

Similar Threads

  1. Unable to change font size of string object at runtime
    By mobichan in forum iOS Export Module Version 2.0
    Replies: 5
    Last Post: 31st July 2012, 03:51 AM
  2. Change font type in string object.
    By Pedro Almeida in forum iOS Export Module Version 2.0
    Replies: 1
    Last Post: 10th February 2012, 06:48 AM
  3. change hotspot & action point during runtime
    By dascribe in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 12th December 2011, 02:04 AM
  4. Hotspot and action point batch change!
    By Aloan in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 25th August 2010, 12:45 AM
  5. how do i change hotspot of objects?
    By piki in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 30th July 2007, 12:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •