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.

Newcomers AppGameKit Corner / Usage of CreateText()?

Author
Message
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 12th Apr 2018 23:24 Edited at: 12th Apr 2018 23:36
Hi guys,

I'm working on a network portal where the user can select a network from the available networks list generated by the broadcastlistener, which should be fairly simple.

However I'm bit confused about the workings of CreateText():
When the list of networks on screen, that was first displayed by CreateText() changes, I use DeleteText() and then use CreateText() again to display the modified list, but it doesn't seem to show that items have been removed.

I thought perhaps I need to use ClearScreen() but that didn't work.

Can anybody please tell me why?


To keep things simple and easy to test I've included a simplified Network Selector and Host Launcher based on the AppGameKit examples:

Network Selector main.agc


Host Launcher main.agc
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 13th Apr 2018 00:07
It looks like you aren't deleting all the old text?
I.e. the deletetext is only cycling through the current list and then immediately rewriting them... You should be deleting the old list
life's one big game
spec= 4ghz, 16gb ram, AMD R9 2700 gpu
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 13th Apr 2018 22:07 Edited at: 13th Apr 2018 22:17
Thanks smallg, that actually did the trick. Updated code below.

Network Selector main.agc


But I've notice 1 thing: the screen shows some flickering when changes have been made, especially when just deleted a network.
Any ideas how to combat this?
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 13th Apr 2018 23:49
too many sync() calls
For c = 1 to networkListSizeOld
If GetTextExists( c ) =1
DeleteText(c) // delete all texts.
EndIf
// Sync() //dont need this
Next c
life's one big game
spec= 4ghz, 16gb ram, AMD R9 2700 gpu
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 14th Apr 2018 13:34
Aaaah, indeed. Working fine now.
Was a remnant of one of my desperate attempts to fix the previous issue.

Many, many thanks for rescuing me of my own clumsiness.

Login to post a reply

Server time is: 2024-03-28 20:17:21
Your offset time is: 2024-03-28 20:17:21