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 / Text input makes virtual buttons not work?

Author
Message
bigtunacan
8
Years of Service
User Offline
Joined: 24th Jul 2015
Location:
Posted: 11th Feb 2016 06:17
I've included a basic code snippet below. I'm not sure what is going on. The button works fine until I add in the text input. Once I put in the text input that captures everything and the buttons no longer work?


CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 11th Feb 2016 07:44
You are loading your images, creating the virtual button, and setting up the text at EVERY frame. A lot of your code should be before the "do" of the loop.
V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 11th Feb 2016 13:40
or move the DO some rows lower.
i guess this SetVirtualButtonImageDown is also part of initialisation, means same SetVirtualButtonImageUp
AGK (Steam) V2.0.16 : Windows 10 Pro 64 Bit : AMD (15.30.1025) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
bigtunacan
8
Years of Service
User Offline
Joined: 24th Jul 2015
Location:
Posted: 11th Feb 2016 15:06
Most of this was directly taken from some documentation sample code. I understand the button initialization should not be in the loop, but that does work when run alone and is not the issue that I am having.

The issue is with the following line of code.



The StartTextInput function takes control over the entire application and pushes everything into the background. So I believe it must be that I need to setup a text input and then at some point in time fire this StartTextInput button only if the user clicks into the field and then disable when they are done, but I'm not sure how to do this with AGK.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 11th Feb 2016 15:18
StartTextInput() is only there for compaitiblity with older code.
Take a look at CreateEditBox() and the associated commands.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 11th Feb 2016 17:44
about StartTextInput u find a example from me in the online help, i used it with a help of a function as input prompt.
http://www.appgamekit.com/documentation/Reference/Input/StartTextInput.htm
as batvink said, a editbox is better.
everything about input is here
http://www.appgamekit.com/documentation/Reference/Input.htm
AGK (Steam) V2.0.16 : Windows 10 Pro 64 Bit : AMD (15.30.1025) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
bigtunacan
8
Years of Service
User Offline
Joined: 24th Jul 2015
Location:
Posted: 13th Feb 2016 04:44
Thanks BatVink that was what I needed.

Login to post a reply

Server time is: 2024-04-23 19:23:00
Your offset time is: 2024-04-23 19:23:00