on renamebuttons repeat with j = 1 to the number of castlibs repeat with i = 1 to the number of members of castlib j mem=member (i, j) nm=mem.name repeat with k = 1 to nm.length if nm.char[k] = ''_'' then put '' '' into nm.char[k] end repeat mem.name=nm end repeat end repeat end |
on renamebuttonsbylib lib if voidp (lib) then lib= the activecastlib s=castlib (lib).selection repeat with lyst in s repeat with i = lyst[1] to lyst[2] mem = member (i, lib) nm = mem.name off = offset (''_'', nm) if off <> 0 then put '' '' into nm.char[off] mem.name=nm end repeat end repeat end |
on transformbitmaps lib if voidp (lib) then lib= the activecastlib s=castlib (lib).selection repeat with lyst in s repeat with i = lyst[1] to lyst[2] mem = member (i, lib) if mem.type <> #bitmap then next repeat im = mem.image if im.depth = 32 then im2=image (im.width, im.height, 16) im2.copypixels (im, im.rect, im.rect) reg = mem.regpoint mem.image = im2 mem.regpoint = reg end if end repeat end repeat end |
on converttofield lib, retain, sameplace if voidp (lib) then lib = the activecastlib if voidp (retain) then retain = 1 if voidp (sameplace) then sameplace = 1 s=castlib (lib).selection repeat with lyst in s repeat with i = lyst[1] to lyst[2] mem=member (i, lib) if mem.type <> #text then next repeat if sameplace then newmem = new (#text) newmem.media = mem.media newmem.name = mem.name erase mem mem=newmem f=new (#field, member (i, lib)) else f = new (#field) end if f.text = mem.text f.rect=mem.rect f.alignment = string (mem.alignment) f.name = mem.name repeat with k = 1 to mem.text.length the font of char k of field f = mem.char[k].font the fontsize of char k of field f = mem.char[k].fontsize s = mem.char[k].fontstyle tx = '''' repeat with sym in s tx = tx & sym & '','' end repeat if tx.length > 0 then delete tx.char[tx.length] the fontstyle of char k of field f = tx end if end repeat if not retain then erase mem end repeat end repeat end |
on drawsquare w, nm, col, bg, s v=new (#vectorshape) v.vertexlist = [[#vertex: point (0, 0)], [#vertex: point (0, w)], [#vertex: point (w, w)], [#vertex: point (w, 0)]] if voidp (bg) then bg = rgb (255, 255, 255) if voidp (col) then col = rgb (0, 0, 0) if voidp (s) then s = 1 v.backgroundcolor = bg v.strokecolor = col v.strokewidth = s v.closed = 1 v.fillmode = #none mem = new (#bitmap) mem.image = v.image mem.name = string (nm) erase v end |
on drawmaze m, w if voidp (w) then w = 20 vert = m.count hor = m[1].count maze = image (w * hor + 1, w * vert + 1, 16) repeat with i = 1 to vert repeat with j = 1 to hor sq = m[ i ][j] if sq mod 2 or i = vert then maze.draw ((j - 1) * w, i * w, j * w, i * w + 1, rgb (0, 0, 0)) if sq > 1 or j = hor then maze.draw (j * w, (i - 1) * w, j * w + 1, i * w, rgb (0, 0, 0)) end repeat end repeat maze.draw (0, 0, 1, w * vert, rgb (0, 0, 0)) maze.draw (0, 0, w * hor, 1, rgb (0, 0, 0)) mem = new (#bitmap) mem.image = maze end |
欢迎光临 初级视频编辑室|草蜢非编论坛|初级视编室|草蜢视频编辑|会声会影|威力导演|电子相册 (http://shibianshi.com/) | Powered by Discuz! X3.2 |