[SOLVED] multiuser draw question

All Union Platform questions, comments, feature requests, and bug reports.

multiuser draw question  

Postby Tony » Tue 26 Nov 2013 20:09

I'm interested to multiuser draw app and I'd tried the example.

I found once a new client joins a room, the client can't see anything drew by others before. The client sees a blank canvas!! How to resolve it? thanks.
Tony
 
Posts: 1
Joined: Tue 26 Nov 2013 19:51

Re: multiuser draw question

Postby colin » Tue 26 Nov 2013 20:39

hi tony,
if you want to keep a history, you'll have to add some server-side code to the example. the general approach would be:

-create a server-side room module for the drawing room
-as each client sends a drawing command, either store the command server-side or add to a server-side image that depicts the current canvas
-when a client joins, either send message(s) from the server containing the content of the canvas, or if you've been maintaining a server-side image, have the client load that image over http or in a Union message as a base64-encoded string.
-display the loaded drawing in the client

there are lots of details that will vary depending on your desired feature set, but the preceding general steps should apply to any implementation.

here's some info on coding room modules:
-java: http://www.unionplatform.com/?page_id=1072
-javascript: http://www.unionplatform.com/?page_id=2615

colin
colin
 
Posts: 232
Joined: Mon 17 Oct 2011 18:47


Return to Union Platform

Online

Users browsing this forum: No registered users and 4 guests