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 / help load jpg

Author
Message
darzon
14
Years of Service
User Offline
Joined: 23rd Oct 2010
Location: Italy
Posted: 15th Mar 2019 20:36 Edited at: 15th Mar 2019 20:37
Hi,
I want to write an app (in AppGameKit tier1) for Android

i explain what i want to do:

I have a number unknown of file images ( in format .pgn or .jpg ) in a folder , but for this example suppose are 3 image in folder name: img01.png , img02.png , img03.png

my app must:

1) read the folder and with Drawtext function write the name of the 3 file on screen.

2) when tap on the name , I have to load the corresponding image with loadimage function.

the point n.1 I know ho to do and also I know how using the LoadImage function so the loading of the image is not a problem.

instead i dont Know how make the point 2 ,in particular how to control the tap

There is a mode to control when tap on a text ?

thank you.
puzzler2018
User Banned
Posted: 15th Mar 2019 20:50
You need some kind of collision, so converting the text to a sprite and do a spritecollision test maybe best way to go.

But im afraid im stuck in getting that to you as im heavily on something else at the moment

Im sure guys here will guide you

Tier 1 Developer
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 15th Mar 2019 21:27 Edited at: 15th Mar 2019 21:30
This will return the value of sprite by the touch event and with windows/mac you can use the rawfile like that


but for android look at these commands for file management


There was a great android example on the forum i just cant find it
fubar
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 16th Mar 2019 07:44
i'm assuming? that you want to use the built-in text commands since you stated:
Quote: "...with Drawtext function"



...which i wouldn't recommend since the GetTextHitTest() is very basic (requiring the brute-force approach above, cycling thru all Text objects) and you'll have to sort things out if you have more filenames than fit on the screen, etc, but if you're looking for basic functionality, the above would do it.

darzon
14
Years of Service
User Offline
Joined: 23rd Oct 2010
Location: Italy
Posted: 16th Mar 2019 13:12 Edited at: 16th Mar 2019 13:17
thank you very very much to all you Virtual Nomad, fubarpk and puzzler2018

Login to post a reply

Server time is: 2024-11-05 23:16:11
Your offset time is: 2024-11-05 23:16:11