⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 polygon.as

📁 FlashEd 0.2 是个游戏引擎包
💻 AS
字号:
/*******************ENGLISHproject: 3d engineby: ivan ivanoff (www.i2off.org)based on the work made by : stuart schoneveld (www.illogicz.com) email: avatar@i2off.orgapologies:	to my wife and kids for supporting me.	to jorge, valerialaura & mariano, for bothering them all the time.	thx to valerialaura for the english translation--------------------ABOUT THIS CLASSthis class is instanciated to create a polygon.polygons are lists of commands indicating what to do with the coords of the model.--------------------HOW TO USE-the instance must be constructed with the list of commands as parameterthe list is an array, where each element is also an array representing the coord, a command, and an extra element that might be an array itself containing parameters.i.e.:		var ld = new Array()	ld.push([0, 'moveTo']);	ld.push([1, 'lineTo']);	ld.push([2, 'lineTo']);	ld.push([3, 'lineTo']);	ld.push([0, 'lineTo']);	model.addPolygon(new Polygon(ld));	below is a list of possible commands and parameters[coord, "lineTo"][coord, "moveTo"][coord, "curveTo", [CurveCoord]][null, "beginFill", [colour, alpha]][null, "lineStyle", [colour, thickness, alpha]][coord, "attach", ["linkedObject"]][coord, "attachif", ["linkedObject", attachPossibility]]////////////////////ESPANOLproyecto: engine 3dpor: ivan ivanoff (www.i2off.org)basado en el trabajo de: stuart schoneveld (www.illogicz.com) email: avatar@i2off.orgperdones:	A mi mujer e hijos por aguantar.	A jorge, valeria y mariano, por joderlos a cada rato.	--------------------ACERCA DE ESTA CLASEEsta es instanciada para crear un poligono.Un poligono es una lista de comandos que indican operacion en relacion a coordenadas del modelo--------------------MODO DE USO-la instancia debe ser construida pasandole como parametro la lista de comandos.Dicha lista es un array, donde cada elemento es a su vez un array que representa al comando, la coordenada, y puede tener un elemento mas, que a su ves es aun array con parametros.por ej:		var ld = new Array()	ld.push([0, 'moveTo']);	ld.push([1, 'lineTo']);	ld.push([2, 'lineTo']);	ld.push([3, 'lineTo']);	ld.push([0, 'lineTo']);	model.addPolygon(new Polygon(ld));	la siguiente es la lista de comando posibles y sus parametros necesarios[coordenada, "lineTo"][coordenada, "moveTo"][coordenada, "curveTo", [coordenadaDeCurva]][null, "beginFill", [color, alpha]][null, "lineStyle", [color, grueso, alpha]][coordenada, "attach", ["linkedObject"]][coordenada, "attachif", ["linkedObject", posibilidadDeAttach]]*******************/class Polygon {	var _id	//lo devuelve el model	var isFreezado = false	var listaDibujar	var faceColor	var modColorF = null	function Polygon (ld) {		faceColor = 60 | 60 | random(256)		setCoords(ld)	}	function setCoords (ld) {		listaDibujar = ld	}	function getCoords () {		return listaDibujar	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -