joshcamas Posted November 25, 2014 Author Share Posted November 25, 2014 Quick Question: Does anyone know how to load a json file in the background, without "pausing" the game? This is to load land chunks while your playing and editing, but right now I'm using the $.getJSON function, and it freezes the game until it finishes loading D: Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 25, 2014 Share Posted November 25, 2014 You can do it with $.ajax that loads a php file itself Json load your file and returns it in an echo that you recovered in success: function (data)$.ajax({ url: "file.php", type:'POST', data:"donne="+ res, success: function(data){ }});Works very well for me Quote Link to comment Share on other sites More sharing options...
amorgan Posted November 25, 2014 Share Posted November 25, 2014 Not sure if you are still having troubles with clicks translating correctly, but I think it has to do with the fact that the Firefox's click event behaves differently than Chrome's. the evt.offsetX and evt.offsetY are undefined in Firefox (at least when I was testing it) and it seems that some of your clicking code uses the same. I was having troubles with mozilla clicks also and I noticed this similarity and started looking into (I haven't solved it, but this seems to be a clue in doing such). Here is a reference to the Mozilla developer page about click events: https://developer.mozilla.org/en-US/docs/Web/Events/click Hope it helps. Quote Link to comment Share on other sites More sharing options...
joshcamas Posted November 26, 2014 Author Share Posted November 26, 2014 Not sure if you are still having troubles with clicks translating correctly, but I think it has to do with the fact that the Firefox's click event behaves differently than Chrome's. the evt.offsetX and evt.offsetY are undefined in Firefox (at least when I was testing it) and it seems that some of your clicking code uses the same. I was having troubles with mozilla clicks also and I noticed this similarity and started looking into (I haven't solved it, but this seems to be a clue in doing such). Here is a reference to the Mozilla developer page about click events: https://developer.mozilla.org/en-US/docs/Web/Events/click Hope it helps.Ahhh! That would explain it! Thank you very much, I'll test fixing this! You can do it with $.ajax that loads a php file itself Json load your file and returns it in an echo that you recovered in success: function (data)$.ajax({ url: "file.php", type:'POST', data:"donne="+ res, success: function(data){ }});Works very well for meIf I'm not mistaken the current $.getJSON function is actually a slightly edited $.ajax function.Is there something with this function that doesn't pause the javascript? EDIT: Yeah, the $.getJSON is equal to: $.ajax({dataType: "json",url: url,data: data,success: success}); Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 26, 2014 Share Posted November 26, 2014 You do not need to do this : dataType: "json" ,you call a php file that loads a json file and returns it in the success function $.ajax is asynchrone this should not put your game to pause Quote Link to comment Share on other sites More sharing options...
joshcamas Posted November 27, 2014 Author Share Posted November 27, 2014 ahhh ok that makes sense! Thank you, I'll do that Quote Link to comment Share on other sites More sharing options...
Wingnut Posted June 21, 2015 Share Posted June 21, 2015 Josh, are you still alive? Is SAMAC still alive? We need some fresh URL's, please. thx Quote Link to comment Share on other sites More sharing options...
dbawel Posted June 21, 2015 Share Posted June 21, 2015 Hey Josh, I'm also glad to see you here. You were the inspiration for my real time multiuser drawing app - which now works, but I want MORE, MORE, MORE! We'll never be satisfied, will we? Quote Link to comment Share on other sites More sharing options...
Wingnut Posted June 21, 2015 Share Posted June 21, 2015 Ahh, ya caught me sneakin' around in the back alleys, DB. Yeah, I heard a rumor that Josh b'Gosh was painting on texture-coated mesh, in SAMAC. I thought maybe I could borrow some code... to answer your "x.y pointer events to UV mapping" question. Now I find out that Josh of the Jungle... is missing, too, just like Alby. I wonder if the two of them are making out in the bushes, somewhere. j/k Did you get a fairly new version of Samac, before Josh when ghostly? He's painting on heightMaps, eh? His editor was really targeted to ground/heightmaps, if I remember correctly. I don't know if he ever tried painting textures that were mapped onto other shapes, or not. Anyway, we miss you Josh. Hurry back. DB, I have more to say (when don't I?) and I'll meet you over in your new topic. No, just leave your motorcycle alone, and WALK over to the other topic thread. Friggin' scooterhead. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 21, 2015 Share Posted June 21, 2015 IT seems to me that Josh was talking to recreate his editor with other languages compiled like C# + XNA or C++. IT was therefore questioned its project with the use of Babylon.I guess he abandon Babylon. I could be wrong, but I remember me of a subject or what he asked many questions. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted June 23, 2015 Share Posted June 23, 2015 nod. thx for the info, Dad72. Maybe he tried to do painting on dynamic textures, and went crazy. You did some experimenting with texture painting, too, right? Were you using planes and heightmaps, mostly? Got advice? Test playgrounds/scenes? (thx) I think DBawel is going to try some on-mesh texture painting, soon. I decided to take a tour around the forum and see who had already tried it, and see if I could get DB some helpful hints. *shrug* Did you try some custom brushes? Did you try any "smear" brushes... that didn't apply color, but smudged and smeared colors that were already upon the texture? Did you try any pattern/procedural fills? How about using a small texture as a brush? (thx for any info on all those things if you have some... I appreciate it much!) Hope you're well! Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 23, 2015 Share Posted June 23, 2015 Hello Wingunt, I managed to do what I wanted "approximately", this can probably be improved in the future, but it works.For examples, I think you can figure out how I did on my CastorEngine editor. here: (It's the graphics that displays the tools to paint or sculpt ground: planes or/and heightmaps)https://bitbucket.org/Dad72/castorengine/src/745482db495eaa97e8a70245bc6605bcb3f1a310/Data/Js/Composants/terrain.js?at=master and here: It's all part of the process. it starts line 200 for paint and line up 345 (probably the part that will interest you the most )https://bitbucket.org/Dad72/castorengine/src/745482db495eaa97e8a70245bc6605bcb3f1a310/Data/Js/CastorEditor/WorldCastor.js?at=master PS: the function resizeImage is unnecessary and will be deleted soon, do not take this into account this function If not in this, there are examples on the playground. I'm fine, yes, I hope you do too. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted June 23, 2015 Share Posted June 23, 2015 Wow! Thanks D72! There is a mega-ton of useful things in there. Can you keep that code at those urls... for... 10 years or so? Thanks for the "stuff", and for showing me the exact code lines. Excellent. You used a canvas as a brush. Interesting. No-mesh decals! Compositing? Maybe that's the correct term... maybe not. Lots of hours of work in there, eh D? *nod* I imagine that zooming/unzooming is real important for texture painting. And creating all the basic brush shapes... soft edge, hard edge, phew. I guess that's why Corel and Adobe have so many employees. Thanks again. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.