mirror of
https://github.com/Sheldan/canvas.git
synced 2026-04-15 04:02:52 +00:00
survivors: only displaying the controls if we are on mobile
adding method to detect if mobile
This commit is contained in:
@@ -7,6 +7,10 @@ export function fillDot(position: Vector, size: number, color: string, ctx: Canv
|
||||
ctx.fill();
|
||||
}
|
||||
|
||||
export function isMobile() {
|
||||
return /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
|
||||
}
|
||||
|
||||
export function drawDot(position: Vector, size: number, color: string, ctx: CanvasRenderingContext2D) {
|
||||
ctx.beginPath();
|
||||
ctx.strokeStyle = color;
|
||||
|
||||
Reference in New Issue
Block a user