lishengjun Posted June 13, 2014 Share Posted June 13, 2014 how to sync gui with sim vesion? I add a movie at master by WidgetSpriteVideo like this : /***/ gui = engine.getGui(); sprite_video = new WidgetSpriteVideo(gui,".../.../a.ogv"); gui.addChild(sprite_video,GUI_ALIGN_*); /**/ but I cannot get the same movie at slave; How can I sync the master Gui to slave? Link to comment
unclebob Posted June 16, 2014 Share Posted June 16, 2014 Hi! Just use RPC call and pass current video time at the master to all slaves, that should do the trick. So from the master side it should be something like this: int render() { // typical syncker master code Unigine::Syncker::Master::syncFrame(); Unigine::Syncker::Master::syncPlayer(); Unigine::Syncker::Master::syncRender(); Unigine::Syncker::Master::syncEnd(); // sync video time via RPC call float video_time = sprite_video.getVideoTime(); int ret[0]; Unigine::Syncker::Master::worldCall(~0,"sync_video",(video_time),ret); return 1; } And on the slave side you should have sync_video function which will set video time to the WidgetSpriteVideo on slave machines: int sync_video(float video_time) { sprite_video.setVideoTime(video_time); return 1; } Link to comment
Recommended Posts