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 / Sprite Menu

Author
Message
MetalOS666
9
Years of Service
User Offline
Joined: 26th Apr 2015
Location:
Posted: 26th Apr 2015 06:53
Hello, I am new to AGK2 and I'm looking for a tutorial or sample code for creating the menu of a game with sprite, or each sprite refers to a new window.

Example: 1 sprite window to start the game, sprite 1 to start the window of game options and sprite 1 to start the window of the scores of the game.

I do not know at all how.

Thank you in advance for your help.

PS: sorry for my english I am using Google Translation.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 26th Apr 2015 19:16
how me do.


AGK 108 (B)19 + AppGameKit V2 Beta .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
MetalOS666
9
Years of Service
User Offline
Joined: 26th Apr 2015
Location:
Posted: 3rd May 2015 03:19
Markus Hello and sorry for the late reply. As I begin I have trouble understanding the management of a menu that opens other windows. Here is the beginning of my code to try to make you understand what I want to do. Thank you in advance for your help.

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 3rd May 2015 16:27 Edited at: 3rd May 2015 16:32
ok, try using it in a function.
means if the function returns the screen should look same before u call it.

seems u have a main screen with 4 menu buttons and 4 other screens u want open.
u need minimum 5 functions.
things like global font ids u can give as parameter to a function.
using global variables from inside a function will result in problems
because u not see direct what the function get as input.

instead of CreateSprite(LoadImage try using LoadSprite because u loss
the image id and the image memory are only released at end of your app.
but if u need one image for more sprites using
image=LoadImage("image.jpg")
spr1=CreateSprite(image)
spr2=CreateSprite(image)
spr3=CreateSprite(image)

AGK 108 (B)19 + AppGameKit V2 Beta .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)

Login to post a reply

Server time is: 2024-11-25 21:38:30
Your offset time is: 2024-11-25 21:38:30