Page 1 of 4

commands U.I friendly

Posted: Fri Jan 14, 2022 3:58 am
by Samuele
hello, are there in livecode any other commands such as drag that are more used in nowadays games?
thanks!

Re: commands U.I friendly

Posted: Fri Jan 14, 2022 9:50 am
by richmond62
Can you list the sort of commands you are thinking of?

Re: commands U.I friendly

Posted: Fri Jan 14, 2022 6:54 pm
by andresdt
Create a button and put the script on it

Code: Select all

on mouseDown pButtonNumber
   grab me   
end mouseDown
The result will be a draggable button. Is that what you are looking for?

Re: commands U.I friendly

Posted: Fri Jan 14, 2022 9:25 pm
by richmond62
I would understand "other commands" (plural) to mean more than that.

However, the OP is given to such terseness that sometimes their questions are obscure.

I have requested amplification.

Whether this terseness is due to poor English, or just a heckling way of of demanding things, I'm not exactly sure. But the effect is the latter.

Re: commands U.I friendly

Posted: Fri Jan 14, 2022 11:19 pm
by FourthWorld
Samuele has 78 posts here, most quite obviously in earnest. I'd give a little time before casting judgment on this one.

It's actually a good question: the drag command is a holdover from HC, yet we have little in the engine to handle modern animation effects like multicell sprites, or even threaded animated GIFs.

Re: commands U.I friendly

Posted: Fri Jan 14, 2022 11:55 pm
by richmond62
I am 100% sure Samuele is in earnest.

I was commenting on the terseness of his postings, and not his obvious wish to learn.

Re: commands U.I friendly

Posted: Sat Jan 15, 2022 12:12 am
by FourthWorld
richmond62 wrote:
Fri Jan 14, 2022 11:55 pm
I am 100% sure Samuele is in earnest.

I was commenting on the terseness of his postings, and not his obvious wish to learn.
Maybe he's seen enough of my posts to see how things that are too long to read don't get read, so he's erring the other direction. ;)

Re: commands U.I friendly

Posted: Sat Jan 15, 2022 6:43 pm
by jacque
He's learning LC and making progress. The problem with learning a new programming language is that you don't have the vocabulary to explain what you're looking for. This is compounded by the fact that English may not be his first language. I don't hold any of that against him.

Re: commands U.I friendly

Posted: Sat Jan 15, 2022 7:25 pm
by richmond62
Nor do I.

HOWEVER, it would be easier to help him if he were more verbose, even if he used what we might
term everyday terms, or even supplied some diagrams.

Re: commands U.I friendly

Posted: Sun Jan 16, 2022 2:24 pm
by Samuele
:shock: I didn't want to cause any discussions, but wll all the things that you said are true, english is not my first language and it's difficult for me to express myself in english let alone using livecode or programming terms, but i try, and you'0re right that it's complicated to understand exactly what i mean. So i'll try to explain better, for exapmle what andresdt said
andresdt wrote:
Fri Jan 14, 2022 6:54 pm
a draggable button
but that's just one of... my question is are they any other commands like that (you may see them in other apps/games) or as FourthWorld said
FourthWorld wrote:
Fri Jan 14, 2022 11:19 pm
modern animation effects
or better for exaple the "movements" you can see on this picture
Immagine 2022-01-16 141452.png
Immagine 2022-01-16 141452.png (32.07 KiB) Viewed 11638 times
you may want to use one for exaple if you want to 'kick' a ball in a game ecc.
So, sorry for my english and thanks for the support.
Samuele.

Re: commands U.I friendly

Posted: Sun Jan 16, 2022 3:43 pm
by richmond62
balls.jpg
-
https://www.dropbox.com/s/1xrvr2gaui9a5 ... e.zip?dl=0
-

Code in the football:

Code: Select all

on mouseDown
   grab me
end mouseDown

on mouseUp
   if intersect(image "ball", image "goal") then
      set the vis of image "smile" to true
      set the loc of img "ball" to 480, 300
      wait 4 secs
      set the vis of image "smile" to false
   else
      -- do nothing
   end if
end mouseUp
Have a super Sunday. 8)

Re: commands U.I friendly

Posted: Sun Jan 16, 2022 4:53 pm
by richmond62
And BIG, FAT HANDS . . .
-
sweatyPaw.jpg
-
CURSOR X.livecode.zip
Stack
(20.44 KiB) Downloaded 184 times

Re: commands U.I friendly

Posted: Sun Jan 16, 2022 7:14 pm
by jacque
The drag command is the easiest way to do it but you could also use a mouseMove handler to track the mouse and set the location of the object to the mouseloc. This does the same thing but requires more code and needs additional code to exit the drag. It isn't the best way to do it.

What effect do you want besides just moving the control? If you want shadows or other visual changes you can script those before the drag begins.

Re: commands U.I friendly

Posted: Sun Jan 16, 2022 7:18 pm
by Samuele
jacque wrote:
Sun Jan 16, 2022 7:14 pm
What effect do you want besides just moving the control? If you want shadows or other visual changes you can script those before the drag begins.
by the way, I'm looking for mobile.
for example this:
Immagine 2022-01-16 184359.png
Immagine 2022-01-16 184359.png (22.57 KiB) Viewed 11587 times
or this:
Immagine 2022-01-16 184622.png
Immagine 2022-01-16 184622.png (61.56 KiB) Viewed 11587 times
don't know ho to say it, maybe a sort of swipe (for example in a soccer mobile game, you wuold kick the ball by swiping it forward or the way you want it to go).

Re: commands U.I friendly

Posted: Sun Jan 16, 2022 7:47 pm
by richmond62
SShot 2022-01-16 at 20.46.29.png
-