Assign Unicode Character?

1 favourites
  • 4 posts
From the Asset Store
2d warrior machrom platformer game character assets
  • How do I set the character of button text to a Unicode character that can't be typed on a keyboard? For example, Arial includes Greek characters, one of which is "?", represented as 'ϕ' in HTML and a Unicode value of 'U+03D5'. How do I assign this character to the text of the button? (using code, not cut and paste)

  • If by "using code" you mean "using events", then this works:

    Button Set Text to "?"

    If you meant "by numeric code of a character", add Browser object and try this:

    Variable charCode=981
    Button Set Text to Browser.ExecJS("String.fromCharCode("& charCode &")") 
    [/code:1qkt1a7i]
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for the response. The latter option is what I'm looking for, and works here. But being new to Construct, does adding a Browser object add much overhead to a project? The docs seem to say that the browser object simply exposes capabilities that are already present.

  • If you are talking about the project size or performance, then no, adding Browser object doesn't affect that.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)