Life bar but with non-stretch graphics inside.

Get help using Construct 2

Post » Sun Jan 05, 2014 11:50 am

RamPackWobble : Nice implementation. emoaeden2014-01-05 11:51:04
Using R243 for all examples
B
69
S
20
G
6
Posts: 379
Reputation: 9,701

Post » Sun Jan 05, 2014 2:46 pm

Beautiful demo!

I do not have the paid version (and thus not the latest version) because I just got into this a few days ago and I want to evaluate it first. But I think I am gonna buy, because I have put quite a lot of thought and work now. ;)

One of the reasons of me considering construct 2 is that the community seem to be helpful in a nice clear forum view.

Ok not very constructive reply but still. ;)

Oh hey, returned to look at the demo, not seeing the code, so I worry about the background since it is black or solid color or fixed graphic. The background in my project is a scrolling background. The "Liquid" itself can be solid but the test tube is transparent and the bottom of the tube is rounded.
B
58
S
18
G
13
Posts: 447
Reputation: 10,740

Post » Sun Jan 05, 2014 4:59 pm

I am not sure if it is what you are looking for but have you considered using a 9patch?

It basically allows you to choose on the image what parts you want to stretch... and what parts you dont.

B
3
Posts: 36
Reputation: 299

Post » Sun Jan 05, 2014 5:11 pm

Interesting idea.
B
58
S
18
G
13
Posts: 447
Reputation: 10,740

Post » Sun Jan 05, 2014 5:55 pm

in Cannonball Bash I used 9patch to make my graduated box over a tiled background object. The 9 patch is set on repeat, so it is actually only one segment wide, and the background is transparent.

so you can see how one would work here: http://cannonballbash.clay.io/

B
242
S
63
G
33
Posts: 903
Reputation: 40,756

Post » Sun Jan 05, 2014 11:38 pm

I can't use masking object because of the transparency to background everywhere.. ;)

Not perfect but I solved it by two pieces of graphic, one solid color for the end cap (the rounded at bottom of tube) and then one gradient object, that is two color gradient. I settled for it instead for rainbow easier to implement.. Level change by change size of the object..

I did the 100% of the coding myself (I feel proud, I am not so well versed in math)

Now to solve so it will grow smoothly from one position to another.. (like from 16% to 33%)

And oh btw I bought Construction 2 from free to user license. Now I need more incentive to finish this game.helena2014-01-05 23:38:51
B
58
S
18
G
13
Posts: 447
Reputation: 10,740

Post » Sun Jan 05, 2014 11:53 pm

So basically I am contradicting myself. ;)
B
58
S
18
G
13
Posts: 447
Reputation: 10,740

Post » Mon Jan 06, 2014 6:01 pm

Here is another way based on a method by @ramones

It uses the tiled background - which would allow you to use different shapes with no masking so your liquid / test-tube can be seen through. A clever idea that I wish I had thought of.

Ramones example can be found here

My example here
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,892

Post » Mon Jan 06, 2014 7:18 pm

Oooh! Thank you, I will look at it!

Done, it looks neat!helena2014-01-06 19:22:00
B
58
S
18
G
13
Posts: 447
Reputation: 10,740

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 30 guests