Tag Info

New answers tagged

0

I didn't read your code but I think what you're looking for is something like this: var currentZoom, //The zoom % circleCenterX, circleCenterY, // The circles center for viewing dotX, dotY // The dots center for vieweing function zoomInOrOut(delta) // To zoom out use a negative value { if (delta < 0 && currentZoom <= 1.0) return; // ...


1

while zooming out, check if distance of red-dot and center of circle is more than circle's radius. (Lets call this distance, d) if so happened, move the circle in direction of V vector ( V = red-dot.position - circle.position`) for x unit. (x= d-circle's radius).


0

If the aspect ratio remains constant, just scale the bitmaps. GUI elements might need some different handling though. For a more robust approach: Do your research into what resolutions are available for your target platforms and pick the most often used ones Create GUI configurations (ideally, purely visual rather than making more objects visible, etc) for ...


1

When you want a really advanced light engine where objects create shadows, you should look into WebGL and use a 3d engine. But when you don't need accurate shading and only want objects to create cones of light which illuminate the canvas without respect to content, this is what you could do. Have two canvases, the normal scene and a second background ...



Top 50 recent answers are included