dop2000's Recent Forum Activity

  • The text doesn't change by itself, there must be some event that changes it, right? You can update colors in that event.

    Or create a function which changes text. But make sure to replace all tags in a variable first, before assigning the text to the text object.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • My guess is that this is a bug with Pathfinding behavior. Enemies can't find path although there are no solid obstacles on the layout. Perhaps C3 engine tries to re-use the obstacle map from the first layout and somehow it doesn't work.

    I suggest you file a bug report:

    github.com/Scirra/Construct-bugs/issues

  • Ok, that explains poor performance. You are changing lots of text objects many times, and repeat this on every tick. Say, if you have 10 texts on the layout, from what I can see on the screenshot, you are making 10*11*60=6600 text updates per second, maybe more.

    An obvious fix is to not update them on every tick. Change colors in the same event where you assign texts to text objects, or in "On object created" event.

    You can also reduce the number of text updates if you replace all tags in a string variable first. For example:

    BBCodecolors On Created
     Local variable s
     Set s to BBCodecolors.text
     Set s to replace(s, "&0", "[/color][color=black]"
     Set s to replace(s, "&1", "[/color][color=darkblue]"
     ...
     BBCodecolors set text to s
    
    
  • Updating a couple of texts on every tick shouldn't cause such big drop in performance.

  • Are you using BBcode? It should not consume much cpu. Can you post your project file?

    You can also check these examples:

    https://editor.construct.net/#open=animated-spritefont-effects
    
    https://editor.construct.net/#open=text-formatting
    
    
  • I have no idea what you are asking about. You need to post some pictures or videos or your project file.

  • igortyhon's reply is a bit harsh, but I agree - it makes no sense to use so many functions. It's impossible to understand what's going on in the code.

    Use breakpoints and Debug Preview (Shift+F4) to debug your code. Although breakpoints sometimes don't work in functions.

    Also I suggest using Browser Log action. For example:

    Browser Log "CurrentTestNum=" & CurrentTestNum

  • Arrays in C3 are stored in JSON format. For some reason the editor doesn't recognize that your JSON is an array. Try changing the array size in that popup window, for example increase array depth. Close/re-open the array, maybe it will revert to table form.

  • Nah, maybe someone else will be able to help. I've given two solutions already.

  • Like I said, I can't make sense of your code. Here is my attempt, it's not pretty, but perhaps you will find it useful:

    dropbox.com/scl/fi/u6l027n6mai1oqvikgow9/TextResizing.c3p

  • I'm not sure what's going on in your code.

    If you want to change font size with the sprite size, the easiest solution is to add them to a hierarchy. You can do this temporarily, and remove text from hierarchy after resizing.

    Another option is something like this:

    Text set font size to 18*(Spaceship.width/Spaceship.imageWidth)

  • No, it's an old thing, I remember using these expressions in C2.

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 256 followers

Connect with dop2000

Trophy Case

  • 8-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x5
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x13
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

28/44
How to earn trophies