Simulating a Meter

Blank Meter 1
Is it Possible to simulate a meter like this?

1 Like

I have tried something of the sort, but it’s hard to get the exact number.
Say you want a Speedometer,

You’d have to transmit the velocity number to a Rotation behavior in the needle. Since the acceleration won’t be the same at higher speeds, you’ll have to add some math that increases the angle at higher speeds to get the needle to point towards the exact number on the meter.

I think meters are a bit too much of a hassle. Just a number would do fine for me.

It’s just for a smimulator with the needle constantly moving back & forth

1 Like

Oh, that’s quite simple.

Perfect. Any ideas how i can go about it please?

1 Like

Oh, sure.

You will need two objects: The meter, and the needle. Both are pretty simple. I can pre-draw them both for you, if you want.
The needle needs to start in the middle of its sprite, so you can use rotation to spin it.
The meter does not need any behaviors.
Find out how far you want the needle to travel (in degrees), and use a timer and some filters to find out when the needle hits those two points.

If you want, I can draw the sprites and pre-make the code for you to import.

I have a needle in my speedometer example.
I have a bundle called a range converter that lets you convert a range of numbers into a percentage and vice versa.

1 Like

That would be good, thank u very much. I would appreciate that.

Is there also a way to set up a random gerator So if u laded on another planet the meter would show different positions?

1 Like

That looks terrific. I like that.

… I don’t know.

What resolution do you want the sprites?

What resolution do I have to chose from?

1 Like

Any, just tell me the size in blocks and resolution of the pixels.

Passion Meter
This is what i plan to use as a radition Meter. I just have to remove the needle and the passion meter.

1 Like

Here are the sprites. I’ll get right to work on the code.
image
image
Download these images and upload them to the sprite editor.

Excellent thank u so much

{"data":{"behavior":{"v":"2","nodes":[{"inputCount":1,"outputCount":0,"name":"Needle Rotation","behaviorType":"logic.NodeGroup","x":-360,"y":96,"group":"","id":"7dfcf6a2792d1849","notes":"Only input numbers divisible by 2","n_o":0,"isMenuItem":false},{"inputCount":0,"outputCount":1,"name":"Once","behaviorType":"logic.triggers.Once","x":-360,"y":96,"group":"7dfcf6a2792d1849","id":"7df4d06410f12d49","resetOnLevelStart":false},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":-180,"y":96,"group":"7dfcf6a2792d1849","id":"7df4e13b0a710d47","startVal":306,"tag":"","roundMode":1},{"inputCount":2,"outputCount":2,"name":"Rotation","behaviorType":"logic.properties.Rotation","x":540,"y":80,"group":"7dfcf6a2792d1849","id":"7df4f1d374e4884c","fpv":false},{"delay":0.1,"count":0,"version":2,"inputCount":3,"outputCount":1,"name":"Timer","behaviorType":"logic.triggers.Timer","x":-360,"y":-16,"group":"7dfcf6a2792d1849","id":"7df84dd2f8403d44"},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":-180,"y":0,"group":"7dfcf6a2792d1849","id":"7df91f431905be4e","startVal":2,"tag":"","roundMode":1},{"gateVal":56,"mode":"equal to","inputCount":2,"outputCount":2,"name":"Filter","behaviorType":"logic.logic.Filter2","x":0,"y":0,"group":"7dfcf6a2792d1849","id":"7df958f482704041"},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":180,"y":0,"group":"7dfcf6a2792d1849","id":"7df977bb14563348","startVal":-2,"tag":"","roundMode":1},{"gateVal":360,"mode":"equal to","inputCount":2,"outputCount":2,"name":"Filter","behaviorType":"logic.logic.Filter2","x":0,"y":192,"group":"7dfcf6a2792d1849","id":"7df9ed1cfa910042"},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":180,"y":160,"group":"7dfcf6a2792d1849","id":"7dfa1dd5b46b2c40","startVal":0,"tag":"","roundMode":1},{"gateVal":0,"mode":"equal to","inputCount":2,"outputCount":2,"name":"Filter","behaviorType":"logic.logic.Filter2","x":0,"y":304,"group":"7dfcf6a2792d1849","id":"7dfaa94aff062f46"},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":180,"y":288,"group":"7dfcf6a2792d1849","id":"7dfae1cb8743154c","startVal":360,"tag":"","roundMode":1},{"gateVal":306,"mode":"equal to","inputCount":2,"outputCount":2,"name":"Filter","behaviorType":"logic.logic.Filter2","x":0,"y":-112,"group":"7dfcf6a2792d1849","id":"7dfb6a5b1ceab940"},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":180,"y":-112,"group":"7dfcf6a2792d1849","id":"7dfb8b34312f8146","startVal":2,"tag":"","roundMode":1},{"inputCount":3,"outputCount":1,"name":"Switch","behaviorType":"logic.logic.Switch","x":360,"y":80,"group":"7dfcf6a2792d1849","id":"7e0002139c30284c","_startVal":1,"dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":180,"y":80,"group":"7dfcf6a2792d1849","id":"7e0032cca0c6d542","portId":"7dfcf6a2792d1849i0","tag":"Stop","dataType":2}],"links":[{"input_id":"7df4e13b0a710d47i1","output_id":"7df4d06410f12d49o0"},{"input_id":"7dfb6a5b1ceab940i1","output_id":"7df4e13b0a710d47o0"},{"input_id":"7df958f482704041i1","output_id":"7df4e13b0a710d47o0"},{"input_id":"7e0002139c30284ci2","output_id":"7df4e13b0a710d47o0"},{"input_id":"7df9ed1cfa910042i1","output_id":"7df4e13b0a710d47o0"},{"input_id":"7dfaa94aff062f46i1","output_id":"7df4e13b0a710d47o0"},{"input_id":"7df91f431905be4ei1","output_id":"7df84dd2f8403d44o0"},{"input_id":"7df4e13b0a710d47i2","output_id":"7df91f431905be4eo0"},{"input_id":"7df977bb14563348i1","output_id":"7df958f482704041o0"},{"input_id":"7df91f431905be4ei0","output_id":"7df977bb14563348o0"},{"input_id":"7dfa1dd5b46b2c40i1","output_id":"7df9ed1cfa910042o0"},{"input_id":"7df4e13b0a710d47i0","output_id":"7dfa1dd5b46b2c40o0"},{"input_id":"7dfae1cb8743154ci1","output_id":"7dfaa94aff062f46o0"},{"input_id":"7df4e13b0a710d47i0","output_id":"7dfae1cb8743154co0"},{"input_id":"7dfb8b34312f8146i1","output_id":"7dfb6a5b1ceab940o0"},{"input_id":"7df91f431905be4ei0","output_id":"7dfb8b34312f8146o0"},{"input_id":"7df4f1d374e4884ci0","output_id":"7e0002139c30284co0"},{"input_id":"7e0002139c30284ci0","output_id":"7e0032cca0c6d542o0"}]}}}

Here is the code for the needle to go back and forth.

Thank u. How do I use this code?

1 Like

Copy the text with the button in the upper right of the code and import it into your game. It should work right off the bat.

I dont have a premium account. I’ll be getting 1 next week. does the import function only work for the premium acount?

1 Like

It works with a free account.

Just click inside of the behavior editor and there should be an import button.