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 / I love AGK, but sometimes, it drives me crazy and I don't GET it, pun intended! (I am looking at you AddVirtualButton) ... sometimes, AGK Whhhyyyy?

Author
Message
Xaby
FPSC Reloaded TGC Backer
11
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 14th Dec 2018 08:29
Hello my dears fans,

Why?

This example of the "function" syntax drives me crazy.
https://www.appgamekit.com/documentation/language/29_function.htm

Why? Because I don't get the information about how to RETURN a value from a function. I have to look up some GUIDES, to discover, that I read at the wrong guied or I have to look up in the AppGameKit board for my answer.
One sentense more, or one example more and this could saved hours of newcomers or people who are working with some languages and need a single source of truth.

The second sentense could be about how to REF reference a variable. And also WHY? ... I can't REF a "normal" STRING, but only my own TYPES.

....

Okay, now to VirtualButton. I hate you VirtualButton and I love it.

It is CreateImage, CreateMemBlock, CreateSprite, CreateText, CreateEditBox ...

But it's AddVirtualButton ... so something would have to be created before, I guess.

I can SET the position of the VirtualButton with SetVirtualButtonPosition ... BUT! Where is my GETvirtualButtonX / Y?
There is VirtualButton ImageDown and ImageUp, but no ImageOver / ImageMouseOver

VirtualButtonSize and Text, but how do I change the SIZE of the TEXT on the BUTTON?

It is DeleteVirtualButton, but from what? There is CreateTweenChain ... AddTweenChain ... and DeleteTweenChain, ClearTweenChain ... so what is created with VirtualButton ...


Maybe there is a much better system to create a menu-system and the VirtualButton is only for a very rough prototype. But then, why I can set TEXT and change COLOR?

Thanx. Maybe you feel the same or you have some answers for me
fubarpk
Moderator
14
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 14th Dec 2018 09:05
Quote: "Why? Because I don't get the information about how to RETURN a value from a function. "




Quote: "VirtualButtonSize and Text, but how do I change the SIZE of the TEXT on the BUTTON?"

your right cant set the size of the text as it auto sizes to fit inside the button so a bigger button and less text the bigger the writing
fubar
Kevin Picone
16
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 14th Dec 2018 09:18 Edited at: 14th Dec 2018 09:19
EndFunction + ExitFunction

For returns just place the to be returned value after the End Funtion

PlayBASIC To HTML5/WEB - Convert PlayBASIC To Machine Code
fubarpk
Moderator
14
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 14th Dec 2018 09:22 Edited at: 14th Dec 2018 09:25
Quote: "EndFunction + ExitFunction"

The following is the same but demonstrates the exitfunction returning result if its less than zero otherwise it just goes to the endfunction


ExitFunction is pointless in my example but it is usefull if there is a complex algorithm working out values and you want to exit early with or without a value
fubar
Xaby
FPSC Reloaded TGC Backer
11
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 14th Dec 2018 12:37
@fubarpk

The value-return of a function was more a "why does that not written in the help document". I know it, but I am using AppGameKit for years now and also know, that there are these kind of options in programming languages.

Or what about LinkedLists? Do understand, what it is in AppGameKit, or how to get arround, it is a little bit confusing. I guess, dynamic arrays are nearly the same es LinkedLists in other languages.

What I mean is, that I sometimes don't understand what AppGameKit wants to be For beginners it misses a lot in the help files. For "experts", it misses a lot in the helpfiles. The problem is, that even if you know, what you are looking for, you often don't find it.


Also some of the String-functions are named a little bit "funny" sometimes. GetStringToken2() in PureBasic it would be called "Syntax: Ergebnis$ = StringField(String$, Index, Trennzeichen$)" StringFiled()
And to find all String-commands, I have to know, that this is in the CORE from the help.

I also miss sometimes commands that do something similar as suggestion for also "lookups"
PartTimeCoder
AGK Tool Maker
4
Years of Service
User Offline
Joined: 9th Mar 2015
Location: Suffolk UK
Posted: 14th Dec 2018 18:39 Edited at: 14th Dec 2018 18:41
Quote: "Or what about LinkedLists?"


oooh! LinkedLists, I would sell my granny for LinkedList/Structure support in AppGameKit, in fact scrap the entire language and make PureBasic export to android and I would be in absolute heaven...... I dont think its high on Fred and Timo's list of todo's though.

you could though, use my plugin framework and write your games in PureBasic and just include it as a plugin:

code to long to post (3700 lines), .pbi attached

Attachments

Login to view attachments
Xaby
FPSC Reloaded TGC Backer
11
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 14th Dec 2018 22:06
@PartTimeCoder ...

so it would be possible to have Source in PureBasic create something ... make a plugIn out of that for AppGameKit and export from AppGameKit to APK? Or would it nearly as complicated as using SpiderBasic for an HTML5-JavaScript-PhoneGap-APK-thingly?

I thought about a "pre-compiler" that translates AGK2 commands into PureBasic or more the other way arround. But the Gadget-System is missing, the Render-Pipeline is different and also the MemBlocks ... puh ...

I am also missing in AppGameKit the ";" semicolon-comment, but hey ...

Also every file action I am doing, I try with AppGameKit, or also creating images with something in it, but for better and faster creation time, I am back in PureBasic.

I thought about, sometimes, what if I only create my game for Windows? Or later Mac or Linux? That would also work with PureBasic and Steam. So AppGameKit also has no console support and creating a game for Android ... is this really a thing anymore?

Stargate (Dune2077) created a new 3D engine for PureBasic without Ogre, and it looks great. https://www.unionbytes.de/projects/ube/

Chmava
5
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 6th Jan 2019 02:51
This is why we stop using anything virtual button and created our own virtual button script!
It support everything a button need!
This include hover if it is a desktop apps!

Try it!
Save you months of headache!
PHeMoX
1
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 13th Jan 2019 00:49
Yeah, I'm also slightly annoyed we can not find functions or AppGameKit specific commands using the search function in the Help documents when the explanations only exist in one of the Guides, Principles, Development Tips areas etc.
I don't know if the Help search can be expanded to search within code examples sometimes present with (other) command explanations, but that alone might solve quite a bunch of 'search' issues.

I don't think the Help files are that terrible once you know where to look though, I've seen much worse for other programs.

I do hope the AR commands for example will get some kind of explanations soon. I can't get it to work, although admittedly I have given up rather quickly.

Login to post a reply

Server time is: 2019-03-23 20:14:15
Your offset time is: 2019-03-23 20:14:15