08.08.14, 15:24
Hello, I'm currently working with the Graffmaster Script. I want to use symbols that works in random positions and sizes, but all I get is the symbol in the middle and not in random positions.
This is what I have at the moment.
Any help will be valuable for me.
Thanks
var values = { size: 50, radius: 100, dichte: 10 } function onOptions() { values = Dialog.prompt('graffmaster:', { size: { description: 'size' }, radius: { description: 'radius' }, dichte: { description: 'dichte' } }, values); } function onMouseDrag(event) { for (var i = 1; i < values.dichte; i++) { var rotation = (Math.random() * 360).toRadians(); var rota = (Math.random() * 105).toRadians(); var ro = (Math.random() * 240).toRadians(); var roma = (Math.random() * 45).toRadians(); var rad = new Point(values.radius * Math.random(), values.radius * Math.random()); var center = event.point + rad.rotate(rotation); var cen = event.point + rad.rotate(rota); var cento = event.point + rad.rotate(ro); var centoro = event.point + rad.rotate(roma); var newSize = values.size * Math.random(); var newSi = values.size * Math.random(); var newSixe = values.size * Math.random(); var RegularPolygon = new Path.RegularPolygon(cen, 5, newSi); var Triangle = new Path.RegularPolygon(cento, 3, newSixe); var Circle = new Path.Circle(center, newSize); RegularPolygon.fillColor = new CMYKColor(0.1, 0, 1, 0); Circle.fillColor = new CMYKColor(Math.random(), 1, 0, 0); Triangle.fillColor = new CMYKColor(1, 0, 0, 0); var symbol = document.symbols['Rocket']; var placedSymbol = new PlacedSymbol(symbol, centoro); var symbol = document.symbols['Ro']; var placedSymbol = new PlacedSymbol(symbol, cento); var symbol = document.symbols['Ret']; var placedSymbol = new PlacedSymbol(symbol, cen); } }