create a free hand curve
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
create a free hand curve
when i create a graphic i want to make sure the graphic is a free hand curve so i can add some points to it. how do i go about doing this?
Re: create a free hand curve
Hi Da_Elf,
you mean by script? This:
...
set the style of the templategraphic to "curve"
## Optional:
## set the points of the templategraphic to list_of_points
create graphic
reset the templategraphic
...
should do the trick.
Best
Klaus
you mean by script? This:
...
set the style of the templategraphic to "curve"
## Optional:
## set the points of the templategraphic to list_of_points
create graphic
reset the templategraphic
...
should do the trick.
Best
Klaus
Re: create a free hand curve
Code: Select all
on mouseUp
put "poly6" into gn
if there is no grc gn then create grc gn
set style of grc gn to "polygon" # <----------
set points of grc gn to iAmAHexagon()
set loc of grc gn to 200,200 -- loc is 230,230
end mouseUp
function iAmAHexagon
return "230,130" &cr& "317,180" &cr& \
"317,280" &cr& "230,330" &cr& \
"143,280" &cr& "143,180" &cr& "230,130"
end iAmAHexagon
shiftLock happens
Re: create a free hand curve
Hi.
Note that early on, only certain vector graphic objects had a "points" property. But now many more (all?) do, with a new property, the "effective points".
Craig Newman
Note that early on, only certain vector graphic objects had a "points" property. But now many more (all?) do, with a new property, the "effective points".
Craig Newman
Re: create a free hand curve
i just created one and hit it for when i need it. would be good to create by type like
create grc "thisone" by type "free hand curve"
create grc "thisone" by type "free hand curve"
Re: create a free hand curve
Hi all.
@Da_Elf
"Free hand curve" is presumably not a style rather a description, the style is "polygon".
Your "Create by type" is alike what Klaus said with using the templategraphic. You could also have several "prototypes" and then clone one of these.
@Craig
You can't *set* the effective points (Da_Elf wishes to set points) ...
[Edit. Replaced the incorrect "type" by "style"]
@Da_Elf
"Free hand curve" is presumably not a style rather a description, the style is "polygon".
Your "Create by type" is alike what Klaus said with using the templategraphic. You could also have several "prototypes" and then clone one of these.
@Craig
You can't *set* the effective points (Da_Elf wishes to set points) ...
[Edit. Replaced the incorrect "type" by "style"]
Last edited by [-hh] on Thu Jul 21, 2016 1:42 am, edited 1 time in total.
shiftLock happens
Re: create a free hand curve
now all i need to do is make an object move along the path
Re: create a free hand curve
That's because you set in the preferences: Property labels are "Description of option".
So you can choose this description as "style" in the property editor.
But try to set this style by script:
Why don't you ask for the style?
Instead of "polygon" you may also use "curve" which is a polygon that has no marker properties.
p.s You don't need to create a graphic in order to move an object along points.
You can simply make a list myList of points (x1,y1) & cr & (x2,y2) ... and then
So you can choose this description as "style" in the property editor.
But try to set this style by script:
Code: Select all
set style of grc 1 to "freehand" -- yields the default, usually a rectangle
Code: Select all
answer the style of grc 1
p.s You don't need to create a graphic in order to move an object along points.
You can simply make a list myList of points (x1,y1) & cr & (x2,y2) ... and then
Code: Select all
move <object> to myList
shiftLock happens
-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am