Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / GetEditBoxText() Problems displaying text in GetTextString() and GetEditBox ()

Author
Message
EricW
11
Years of Service
User Offline
Joined: 17th Jan 2013
Location:
Posted: 24th Feb 2013 12:21
Hi, I'm finally trying to make an app using Tier1, at this point all I want to do is use text commands. My code works fine in Windows 7 with AppGameKit 107. I broadcast using AppGameKit Player V1008 to a Samsung Galaxy Ace phone. My problem is I cannot get strings to display at all they always are blank. Examples I have tried have the same effect, my thoughts are it's to do with the AppGameKit Player. Any help in leading me on the right path greatly appreciated

[
// 0 = Use setup.agc *** -1 = fill the whole screen irrespective of aspect ratio
//SetDisplayAspect(0)
SetDisplayAspect(3.0/4.0)

// Screen Virtual Resolution
//SetVirtualResolution ( 320, 480 )

//Background Image
backdrop = CreateSprite ( LoadImage ( "Background.jpg" ) )
SetSpriteSize ( backdrop, 100, 100 )

global strDisplay$

rem Input label
CreateText (1,"INPUT TEXT")
// SetText (ID,Percent)
SetTextX (1,50)
SetTextY (1,0)
SetTextAlignment ( 1, 1 )
SetTextSize (1,7)

// Setup input text box
createEditBox(2)
setEditBoxMultiline(2,1)
SetEditBoxTextSize (2,5)
setEditBoxSize(2,80,20)
setEditBoxMaxLines(2,6)
setEditBoxPosition(2,10,8)

// Input label
CreateText (3,"HEX VERSION")
SetTextX (3,50)
SetTextY (3,50)
SetTextAlignment (3,1)
SetTextSize (3,7)
SetTextColor ( 3,255,0,0,255)

// Setup output text box
createEditBox(4)
setEditBoxMultiline(4,1)
SetEditBoxTextSize (4,4)
setEditBoxSize(4,80,40)
setEditBoxMaxLines(4,10)
setEditBoxPosition(4,10,58)

// Edit Box 20
CreateEditBox(20)
SetEditBoxSize(20,20,6)
setEditBoxPosition(20,10,40)
SetEditBoxBackGroundColor(20,255,255,255,255)
SeteditBoxTextColor(20,0,0,0)
strText20$ = getEditBoxText(20)
strTest$ = strText20$
//strTest$ = str(val("10") * val("20") )

createText (5,"")
SetTextX (5,50)
SetTextY (5,40)
SetTextSize (5,5)
SetTextColor (5,255,255,0,255)

// Main Loop
do

// Try Display Characters from box 2
strInput$ = getEditBoxText(2)
chrHexx$ = (hex( asc(right(strInput$,1) ) ))
chrBinn$ = (bin( asc(right(strInput$,1) ) ))
chrAsc$ = str(asc(right(strInput$,1) ))
strDisplay$ = chrHexx$ + " - " + chrBinn$ + " - " + chrAsc$

strText20$ = getEditBoxText(20)
strTest$ = strText20$

//if getPointerState() = 1
setEditBoxText(4,strDisplay$)
//endif
setTextString(5,strTest$)
//
Sync()

loop

]
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 25th Feb 2013 19:02
First, where did you get your Player from?

And exactly what version of AppGameKit are you using? The current beta is at v1088.

The display of text in EditBox and TextInput is a known issue for v1088.

Have you tried using a simple Print statement to verify that your strDisplay$ and strTest$ variables are not blank? (You can put a bunch of blank lines before the first Print to position it below your Text and EditBox objects.)

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
EricW
11
Years of Service
User Offline
Joined: 17th Jan 2013
Location:
Posted: 27th Feb 2013 12:27
Firstly thanks for the reply, I am using the V1088 player from www.triassicgames.com recommended on this forum. I have tried using the print statement with the strings the but no joy they are blank, the only command I can get working is the StartTextInput command. If the V1088 player has issues I'll try something else until it's fixed which hopefully wont be long. Also, I guess I should have pasted my code after the it was my first post.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 27th Feb 2013 18:17
It's not the Player that has issues, it is v1088.

I will do some tests with your code in multiple environments and versions later this afternoon. (I need to rush out to the post office right now!)

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 27th Feb 2013 21:57
I just tried your code with two changes. I dropped the lines for setting the background (since you didn't post the image) and added strInput$ to the setting of EditBox 4:
SetEditBoxText(4,strDisplay$+chr(10)+strInput$)

Running on Windows in both v1076 and v1088, everything worked perfectly.

Broadcasting from v1076 to a v1076 Player (on an Android 4.1.1 device), works fine.

Broadcasting from v1088 to a v1088 Player, same results, but the input pop up didn't appear and text entry was directly in the EditBoxes.

Broadcasting from v1076 to a v1088 Player (NOT recommended procedure, by the way), the input was not returned from the EditBoxes and the Player reported an error.

Since, after rereading your original post, I think you were doing the third case, that explains the problem.

Use the correct Player version for the AppGameKit IDE you are broadcasting from. Otherwise, there is not guarantee that anything will work properly.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
EricW
11
Years of Service
User Offline
Joined: 17th Jan 2013
Location:
Posted: 2nd Mar 2013 06:13
Hi, I have just uploaded the V1088 Beta Gamekit and everything works fine now using the changes you gave me and with my original code. The phone I have is using Android 2.3.5 I'm new to smart phones, I do like the fact that I can make apps for it.
Thankyou for your help greatly appreciated
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 2nd Mar 2013 18:01
I am always glad to help.

It's also good to see when tests are done on Android 2.3 (the minimum supported). I had had an Android 3.2 device, but they updated the OS when it was 'fixed' to make the camera work.

Happy Programming!

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2024-05-02 14:09:00
Your offset time is: 2024-05-02 14:09:00