Splinetastic Face

Simple face constructor for kids using splines.
Splines from http://twolivesleft.com/Codea/Talk/discussion/282/splines#Item_3

Ok, picture http://db.tt/NGbujP6b

Wish it shows the screenshot. :frowning:

Awesome, @Alex812a. Looks like great fun. I think a really neat addition could be “morph targets.” Basically you could slide a parameter and move each node to different positions, then when you drag the parameter slider the face animates.

(Also embedded your screenshot here)

Splinetastic Face

How to refresh slider (test) in touched() function?

function setup()

function touched()
if CurrentTouch.state ~= BEGAN then return end
test = CurrentTouch.y

You can’t do that at the moment. Sliders are one way only - you change them and they change the variable, not the other way around.

I didn’t want a case where the user could “fight” with a slider. That is, the slider is changed every frame, and when you try to drag it, it does nothing.

This is how you can give them both control.
The slider always overides the touch.
But both can be used and displayed.

function setup()
    iparameter("sx",1,WIDTH,WIDTH/2) --slider x
    x = sx
    lsx = sx --last slider x

function draw()
    background(0, 0, 0)
    if lsx ~= sx then
        lsx = sx
        x = sx

function touched(touch)
    x = touch.x

You could actually have a slider that says “use slider” 0 or 1, or other logic that determined when the slider is in charge.

In a way, when you get to this point, you’ve “graduated” from sliders and should consider implementing your own sliders and converting to watch()es.

Code :-bd