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.

Android / Display Aspect in Android Tier 2 Error Help!

Author
Message
TheTeenDevs
6
Years of Service
User Offline
Joined: 19th Aug 2012
Location:
Posted: 23rd Dec 2012 02:57
When I use this command in tier 2 in the begin part of the program
void agk::SetDisplayAspect( float 4/3 );
I get this error in the log.txt
jni/template.cpp: In member function 'void app::Begin()':
jni/template.cpp:9:30: error: invalid use of qualified-name 'AGK::agk::SetDisplayAspect'
make: *** [obj/local/armeabi/objs/android_player/template.o] Error 1

Any help would be greatly appreciated! The program compiles fine with just the hello world but when I delete that and put this command in the begin part of the program this happens.
TheTeenDevs
6
Years of Service
User Offline
Joined: 19th Aug 2012
Location:
Posted: 25th Dec 2012 02:38 Edited at: 25th Dec 2012 03:34
Never mind... found that the help file in AppGameKit is probably wrong! This post by ancient lady shows that the void command should be taken away.. now I have issues with virtual joystick..
agk::AddVirtualJoystick(UNIT 2,float 90,float 90,float 10);
I don't know what to do with the UNIT so this gives a syntax error. Thank you in advance for the help!

http://forum.thegamecreators.com/?m=forum_view&t=198965&b=41
JimHawkins
9
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 25th Dec 2012 12:49
Try agk::AddVirtualJoystick(2,90.0,90.0,10.0);

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
TheTeenDevs
6
Years of Service
User Offline
Joined: 19th Aug 2012
Location:
Posted: 25th Dec 2012 16:02 Edited at: 25th Dec 2012 16:44
Thanks JimHawkins! That worked perfectly. I find the internal help file to be a little confusing sometimes.
How do you add different files and create custom functions in tier 2 like the #include function for tier 1?
JimHawkins
9
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 25th Dec 2012 20:39
When so see function prototype it's just telling what the parameters are to that function. You don't repeat those when you use it. When using floating point number ALWAYS out the decimal point in, as above.

Really, this isn't the place to run a tutorial on how to program in C/C++. But, at its simplest:

void MyFunction() {

// do something here...
}

or:

int MyAdder(int a,int b) {

return a + b;
}

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
TheTeenDevs
6
Years of Service
User Offline
Joined: 19th Aug 2012
Location:
Posted: 25th Dec 2012 21:55 Edited at: 25th Dec 2012 22:12
OK... that makes sense! Great! Thanks JimHawkins!
But how would I call the function that I just made?
JimHawkins
9
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 26th Dec 2012 06:39
MyFunc();

int x = MyAdder(3,67);

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
TheTeenDevs
6
Years of Service
User Offline
Joined: 19th Aug 2012
Location:
Posted: 26th Dec 2012 15:25 Edited at: 26th Dec 2012 20:26
I have this issue with other pages.... I have this in charactr.h

I have this in character.cpp

I then tried to put the function into the main program

Eclipse says it's fine but Cygwin gives this error:

and log.txt says:

I've tried everything and tried to emulate this post with character.cpp and character.h and android.mk which is all the info it had:
http://forum.thegamecreators.com/?m=forum_view&t=201167&b=46
Thanks in advance for the help!!!!!
JimHawkins
9
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 28th Dec 2012 10:25
To be honest, I think you need to buy yourself a New Year present of a book on C++.

You haven't declared an instance of the Charactr class, which is why the compiler is complaining:

charactr CH;
CH.CreateBall();

You are trying to call a member function of a class, but you actually need to have an instance - an actual object of the kind you have defined. This is a fundamental part of object-orientated programming. You define classes and then you create as many of them as you want.

Although everybody here tries to be as helpful as possible, we don't have time to run a series of tutorials on programming. Read through the tutorials here:
http://www.cplusplus.com/doc/

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
TheTeenDevs
6
Years of Service
User Offline
Joined: 19th Aug 2012
Location:
Posted: 28th Dec 2012 14:51 Edited at: 28th Dec 2012 14:56
Yeah you're right Jim Hawkins..........I have read tutorials many years back.....I need a refresher.......that seems like a good tutorial and cprogramming.com has a good one too. Reading a book is a good idea! Thanks again for the help!
Ancient Lady
Valued Member
15
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 2nd Jan 2013 16:22
TheTeenDevs, please don't post the exact same thing in multiple threads. I just responded in your other one and referenced the same site as JimHawkins.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2019-05-22 01:32:48
Your offset time is: 2019-05-22 01:32:48