Filling A "Water Tank" Bar Help

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
InLacyWeTrust
Posts: 5
Joined: Tue Nov 19, 2013 3:09 am

Filling A "Water Tank" Bar Help

Post by InLacyWeTrust » Tue Nov 19, 2013 3:25 am

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

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Filling A "Water Tank" Bar Help

Post by dunbarx » Tue Nov 19, 2013 4:09 am

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

InLacyWeTrust
Posts: 5
Joined: Tue Nov 19, 2013 3:09 am

Re: Filling A "Water Tank" Bar Help

Post by InLacyWeTrust » Tue Nov 19, 2013 4:36 am

Is there a way to do that without the cover "tank" being the same color as the background?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Filling A "Water Tank" Bar Help

Post by dunbarx » Tue Nov 19, 2013 2:58 pm

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

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Filling A "Water Tank" Bar Help

Post by dunbarx » Tue Nov 19, 2013 3:32 pm

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

Post Reply