How do I convert a character to ASCII

Get help using Construct 2

Post » Sun Sep 21, 2014 5:48 pm

how can i convert a character to Ascii and vice versa ? :?:
i really need that ,it would save my week because if i don't find a solution i would spend the next week doing it manually.
any help please ?
B
12
S
6
Posts: 118
Reputation: 1,466

Post » Sun Sep 21, 2014 6:12 pm

Message: jakobdam can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
I guess this link can help...?

http://picascii.com/

Or do you mean during runtime in Construct 2...? Is yes, I'd probably have one textfield replace the corresponding sprite at the same coordinate...
B
12
S
2
Posts: 80
Reputation: 816

Post » Sun Sep 21, 2014 7:41 pm

http://stackoverflow.com/questions/9403 ... javascript
Add the browser object and use these expressions to convert over and back.
Browser.ExecJS("'"& char & "'.charCodeAt(0)")
Browser.ExecJS("String.fromCharCode("& ascii &")")
B
92
S
32
G
109
Posts: 5,290
Reputation: 70,991

Post » Sun Sep 21, 2014 10:59 pm

R0J0hound wrote:http://stackoverflow.com/questions/94037/convert-character-to-ascii-code-in-javascript
Add the browser object and use these expressions to convert over and back.
Browser.ExecJS("'"& char & "'.charCodeAt(0)")
Browser.ExecJS("String.fromCharCode("& ascii &")")



thank you i will try that now , :) i know about execute js in the browser object but never thought to you it :3
B
12
S
6
Posts: 118
Reputation: 1,466

Post » Sun Sep 21, 2014 11:16 pm

Message: warville is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
jakobdam wrote:I guess this link can help...?Or do you mean during runtime in Construct 2...? Is yes, I'd probably have one textfield replace the corresponding sprite at the same coordinate...



thats not what i'm looking for , but thanks man! yes i need it in runtime ,
B
12
S
6
Posts: 118
Reputation: 1,466

Post » Sun Sep 21, 2014 11:16 pm

let me tell you why i need it you might suggest me easy solution to my problem, i hade problem with Android keyboard when it shows it scales my page down and make it very small , but i some element are important i need them to still looks big , generally i don't want the page to scaldown. i couldn't figure out how to fix that . so i decided to make my own costum keyboard , i wanted to make buttons for the keyboard but you can't text from button unless you use values don't forget each button have many layers ( i mean lower case , uppercase and special character ) so picking up a value and changing the button text each time isn't a good idea , i thought to make the buttons as sprites, and make 3 different animations for it ( lower case , apper case and special character) i used animations not frame because it have text name while frames uses numbers , so each time you touch the sprite gives you the animation name , and i will name the animations like ( char_91 ) a special text followed by the ascii code of the character shown in the animation then i will remove (char_) , why i use ascii ? because you can't name the animaton with special characters unless you name the button's animation like ("doublecotes") then make text replace and replace that part with doublecotes and that would be a pain to make a special action for each button .
B
12
S
6
Posts: 118
Reputation: 1,466

Post » Mon Sep 22, 2014 12:02 am

R0J0hound wrote:http://stackoverflow.com/questions/94037/convert-character-to-ascii-code-in-javascript
Add the browser object and use these expressions to convert over and back.
Browser.ExecJS("'"& char & "'.charCodeAt(0)")
Browser.ExecJS("String.fromCharCode("& ascii &")")



it works man , thank you very much ^^
B
12
S
6
Posts: 118
Reputation: 1,466

Post » Mon Sep 22, 2014 5:58 am

Oooooh sorry man - I read "character" as a "person" (character <=> sprite), I see now that you meant character as in abcd... d'oh! That certainly changes everything! ^_^
B
12
S
2
Posts: 80
Reputation: 816


Return to How do I....?

Who is online

Users browsing this forum: Euduardo and 27 guests