I've been working with a Javascript library, namely, canvas-lib and I'm using Node.JS/Socket.io on the server side so I can pass events between clients.
I'm using an architecture in which only 1 client at a time is allowed control over the canvas since I'm making kind of a "scratch" game which is controlled by a mobile device and displayed on an second (bigger) screen.
You can see a diagram of the architecture here.
The thing is, currently the canvas interaction is done on the client side on a script for that effect which causes the some problems:
- There's no way of scaling the canvas
- There's not a unified time limit counter
- I have to manually load the page on the external screen
My objectives are:
- To have the server pass the time to both devices (or screens)
- To have the canvas loaded on the mobile device and scaled to the external screen (on new connection, and done automatically once the mobile device is connected, or out of the queue and into current active)
In order to achieve this, I believe I must get the canvas-lib to work on node, so how can I achieve this since the lib is not ready for that yet? How can I turn a regular library into a Node library?