Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi there, I'm building a WebGL project in Coppercube and wondered if there is a way to get the Load Texture action to work with querystrings in a URL? Or any other way of passing in a variable into the URL of the action, so that the textures loaded could be changed depending on parameters rather than static? Any advice would be highly appreciated! Thank you Andy |
||||
|
Don't know if it would work or not.... To get the texture by using a url ....not sure.. |
||||
|
Passing a URL parameter to a script via Load Texture embedded in the Coppercube WebGL build works fine. So, for instance, in the Load Texture parameters box, specififying URL to get from as - www.domain.com/grab-texture.asp?id=1 - with the grab-texture.asp script redirecting to a .jpg image based on the querystring picks up OK and works great. But how could you pass a variable to Load Texture script so that id=1 could be any ID specified by a querystring? It would be great if there was an easy way to do this. :) Andy |
||||
|
You can save variable to a text file... For example save a variable name "ID" and use add value 1 Then in your code to load a texture from a file ... Add something like this... Var id = ccbgetcoppercubevariable("ID") Var url = www.domain.com/grab-texture.asp?id here id is our variable Ccbloadtexturefromfile (url) This can be the idea to fetch variable to url...by loading the coppercube variable into the code itself... And then executing it... Maybe am not explaining it correctly to u... As am not feeling well.... |
||||
|
I have worked with this exact method before andycampbell, it works really well +1 |
||||
|
Thank you so much for your responses! I will give this a go. |
|