User Tag List

Results 1 to 8 of 8

Thread: The dumbest question i've ever asked...

  1. #1
    Clicker

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)Universal Windows Platform Export Module (Steam)
    ratty's Avatar
    Join Date
    Apr 2012
    Posts
    1,165
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    The dumbest question i've ever asked...

    Is there a way to clear out the text in the Rich Edit box other than:

    Block>Select All
    Control>Set Text ""

    It seems to run kind of slow doing it that way but it doesn't seem to work without the select all first. Any input to this dumb question would be a appreciated.

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleMac Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    AyreGuitar's Avatar
    Join Date
    Jan 2011
    Location
    Wales, UK
    Posts
    1,113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's been a long time since I used it, but could you load a blank text file into it?
    Another option might be to make it invisible before selecting all and then back to visible after Set Text ""

  3. #3
    Clicker

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)Universal Windows Platform Export Module (Steam)
    ratty's Avatar
    Join Date
    Apr 2012
    Posts
    1,165
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    The dumbest question i've ever asked...

    The visibility trick will fix the aesthetic issue for sure. Thanks for that!

    I'm still concerned with performance. It seems, for whatever reason, all the selecting slows things down.

  4. #4
    Clicker Multimedia Fusion 2

    Join Date
    Jul 2006
    Location
    UK
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If I understand you correctly, and you want to remove all the text from the rich text object you could try destroying the text object and creating a new one at 0,0 relative to it (i.e in exactly the same place), in the same event.

    [richedit]: destroy
    create [richedit] at 0,0 from [richedit]

    This works in a simple trial, but I don't know how it will affect performance ion a larger project.

  5. #5
    Clickteam Clickteam
    Danny's Avatar
    Join Date
    Aug 2007
    Location
    United Kingdom
    Posts
    3,016
    Mentioned
    21 Post(s)
    Tagged
    2 Thread(s)
    I was going to suggest earlier and Ayre beat me to it. Taccy's routine will probably always out-do "Select All" and "Set Text" in terms of speed but you may just get a slight flicker of destroying and re-creating the object, again this will be down to performance.
    Want to learn Clickteam Fusion 2.5?




  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleMac Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    AyreGuitar's Avatar
    Join Date
    Jan 2011
    Location
    Wales, UK
    Posts
    1,113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ratty - Are you sure it's the Rich Edit Box object that's giving you the slow down? I tried it with a large rtf file and even with select all it cleared it quickly (as did loading a blank file - no noticeable difference in speed). Perhaps isolate it into a fresh app for testing?

    Taccy - nice idea to use the destroyed objects position when creating the new one, but is there a chance that the wrong one could be used before the old object is destroyed at the end of the game loop? I'm a bit fuzzy on when an object that's marked for to be destroyed is actually destroyed!

    Danny - sorry I beat you to it!

  7. #7
    Clicker Multimedia Fusion 2

    Join Date
    Jul 2006
    Location
    UK
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually I was surprised it worked. I created a couple of buttons one to load a text file into the rich edit box and one to clear the richedit (by destroy replace).
    After clearing the richedit the button to load into the text box still worked- and only a single richedit object appears as an object at the top of the event editor.

    Incidentally my first try was to create the new richedit on top of the existing richedit (thus obscuring it with a blank version) and then deleting the old (text filled) object that was now behind, which also works - in other words if you go to the event list view you can change the order. I can only see this working if objects are deleted before new objects created, (otherwise a new object should be created in the editor) but I don't know enough about optimisation to confirm this.

    Also I haven't tried yet - but I assume that this would only work when there is a single instance of the richedit

  8. #8
    Clicker Multimedia Fusion 2

    Join Date
    Jul 2006
    Location
    UK
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've been thinking about this (is it obvious I am getting back into MMF after some time away?) and have come up with another more flexible alternative.

    This assumes that the performance issues were the time that it takes to select the text and then clear it and the associated visuals as the text is selected.

    When you have created your richedit box, clone it and place the copy outside the play area.

    When you want to clear all the text of the onscreen richedit simply swap the positions of the richedit boxes.

    Add a couple of events:- If edit box 1 is outside of the play area then clear the contents (block select and clear, load new file etc) - limited if event loops. Repeat for other richedit box.

    To the user the [swap positions] effectively clears the richedit instantly (no flicker or wait) whilst the actual clearing takes place off screen in another event line.

    This means that, if needed multiple edit boxes just need to control more clones, and it has the added benefit that, in the same manner, you can preload text into the offscreen textbox prior to swapping in for seemingly instant load.

    The payoff will be a small increase in file size.

Similar Threads

  1. Simplest question ever asked...
    By ratty in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 30th May 2012, 03:53 AM
  2. Simon says... / Jeff asked you to...
    By the_raven in forum File Archive
    Replies: 9
    Last Post: 30th July 2006, 12:24 PM

Posting Permissions

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