Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-render an asteroid graphic #2

Open
sn3p opened this issue Nov 22, 2016 · 0 comments
Open

Pre-render an asteroid graphic #2

sn3p opened this issue Nov 22, 2016 · 0 comments

Comments

@sn3p
Copy link
Owner

sn3p commented Nov 22, 2016

Example: http://codepen.io/shableep/pen/RWZmrg?editors=0010

starCanvas = document.createElement('canvas');
starCanvas.setAttribute("width", 20);
starCanvas.setAttribute("height", 20); 
starCTX = starCanvas.getContext("2d");
starCTX.beginPath();
starCTX.arc(10, 10, 3, 0, 2*Math.PI, true);
starCTX.fillStyle = '#FFFFFF';
starCTX.fill();
this.starGraphic = starCanvas;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant