haha your diving headfirst in edge animate
i can't believe it worked but i made you a script in jsfiddle http://jsfiddle.net/XrBy2/91/
if you push update, the radius will update to what nr is in the input box
Wow, thank you for your great work!
But my problem is still not solved, because I don't know how to create a circle in AN on the fly. I mean you made a box which becomes a circle but I need always a full circle with a radius that equals for example 35% of the given number...
hmm i don't really get what you mean.
can you give a further expanation?
or maby other forum users can jump in to help
You could use canvas: placeholder is a text field with a dot in it.
var placeholder = sym.$("placeholder");
var myCanvas = $('<canvas />');
var ctx = myCanvas.getContext("2d");
// make shapes
ctx.fillStyle = "#00A308";
ctx.arc(220, 220, 50, 0, Math.PI*2, true);
you could add a variable for the diameter and use it in the code above.
here is a sample file to which refresh code coud be added. Now you need to refresh the browser to add a new value. I will update the file shortly.
you could use an arc instead of a fill too.
I updated the file with a circle and an arc so you can choose what you prefer. The clear button reloads the page so you can enter a new value. I tried to clear the canvas with
ctx.clearRect(0, 0, canvas.width, canvas.height);
but can't make it work for some reason.
v2 same link
I know resdesign has helped you out with a couple of items, but here's another option for you.
In this sample, I have already placed a circle on the stage and have used the two colored buttons to change the radius. A couple of things to note:
- I'm using the number as the diameter of the circle, not the radius
- The width and the height of the div is actually the diameter
- You can create a div dynamically using appendChild(), and make that into a circle by setting the corners to 50%
This solution does not rely on canvas, and you do get a perfect circle. Sorry for the partial answer, but I think there's enough information there to get you started.
Hope that helps,
Wow guys! Thanks a lot for this great help. You are awesome! I think I can work great with this.
Cool Elaine, great and easier way and more Edgy!
No problem, guys!