I am trying to create a stack of Circles, that are filled blue. However I can't get rid of the stroke or set a new fill.
This is my code:
var width = window.innerWidth,
height = window.innerHeight;
var render = Render.create({
element: document.getElementById('wrapper'),
engine: engine,
width: width,
height: height,
wireframes: false
});
render.canvas.width = width;
render.canvas.height = height;
render.options.wireframeBackground = 'transparent';
render.options.background = 'transparent';
Render.run(render);
// x, y, amt x, amt y, gap x, gap y
var stack = Composites.stack(0, 0, 20, 10, 10, 10, function(x, y) {
return Bodies.circle(x, y, 6, {
friction: 0.1 ,
fillStyle: "0045FF",
render: {
lineWidth: 0
}
});
});
Try this:
render: {
fillStyle: '#0045FF'
}
Yes, works, thanks! Also had to add:
render.options.wireframes = false;
It is kinda weird. It seems like when I create the render the options are not being accepted and I have to override them after creation.
Ah yes that's because you need to put that into options when creating:
var render = Render.create({
element: document.getElementById('wrapper'),
engine: engine,
width: width,
height: height,
options: {
wireframes: false
}
});
hi