Page 1 of 1
Filling A "Water Tank" Bar Help
Posted: Tue Nov 19, 2013 3:25 am
by InLacyWeTrust
Hey Guys,
Fairly new to the LiveCode language, but I am no stranger to programing.
I'm try to make a game that contains two water tanks (LiveCode rounded rectangles) and when a user drags their finger along the tank, the tank will fill to specific amounts 7p to an arbitrary "7" which would be a full tank.
I've looked into mouseMove control, but am wondering what you guys think would be the best way to implement this.
Thanks!
-Adam
Re: Filling A "Water Tank" Bar Help
Posted: Tue Nov 19, 2013 4:09 am
by dunbarx
Hi.
I am not a mobil guy, but the idea would be the same, I suppose.
If I was doing this by dragging the cursor up along that shape, I would have a colored identically shaped object overlaying it, and set the top of that object to the mouseV using the mouseMove message.
Craig Newman
Re: Filling A "Water Tank" Bar Help
Posted: Tue Nov 19, 2013 4:36 am
by InLacyWeTrust
Is there a way to do that without the cover "tank" being the same color as the background?
Re: Filling A "Water Tank" Bar Help
Posted: Tue Nov 19, 2013 2:58 pm
by dunbarx
Not sure what you mean. The "fill" tank can have its own color and borderColor, separate from the underlying "empty" tank. I see, at the start, a white card, a white "empty" tank, and a blue "fill" tank overlying these (thinking water). The blue would fill upwards as one dragged the cursor, tracking the shape (a rectangle?) of the "empty" tank. The height of the "fill" tank can be 0 to show an empty "empty" tank, and increase from there.
Craig
Re: Filling A "Water Tank" Bar Help
Posted: Tue Nov 19, 2013 3:32 pm
by dunbarx
I was cavalier when I mentioned you can set the top of the "fill" tank to the mouseV. What I mean is that I was wrong. This will actually move the tank itself. You will want to set the rect of that tank, using the mouseV to set its top. Are you OK with this?
Craig