Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem


You can use the tag http://tyranobuilder.com/tyranoscript-tags-reference/#html to add an html layer in order to create the canvas element to draw your game.
See the example, inside a TyranoScript box:
http://www.w3schools.com/tags/canvas_drawimage.asp
http://www.html5canvastutorials.com/advanced/html5-canvas-load-image-data-url/
http://www.html5canvastutorials.com/tutorials/html5-canvas-images/
With Tyranobuilder we're looking at the ability to load files from our data directory, instead of a dataurl or server asset. I could turn the image into a base64 string and load it that way but I'd rather load from the directories we're already using for the rest of the game.
It will work well : ) Once your canvas is added to your html layer, you could draw on it any image from the data folder or from a remote domain with cross-origin resouce sharing.
Thank you again!
So something I thought might be easy, is to use window.location to point to a local html file that is the mini game in question. Location moves the WHOLE game (visual novel, not just our context) to the page (fun urls to load using this: html5test.com and whatismybrowser.com).
Now I'm pretty sure contexts can't load html files. And I'm also pretty sure that iframes don't work in tyranobuilder. So would the best solution be making my minigame locally in a regular web browser (html5/canvas) and then copy/pasting that code into a [iscript]?
Maybe you prefer to load the .js inside the index.html or using the [loadjs] tag at the very beginning.
For my experience, putting all the small code inside an [iscript] tag works well.
This is the way I am doing it for snow particles:
I create a .ks file with all the code and then I call it from the game when is requiered or deleted it once is not required anymore.
http://gist.github.com/delacannon/f21d2f3df93e8f30650e
Call the *init_particles or your minigame subroutine like so inside TyranoBuilder:
And delete with:
working example[tb-particles-test-delacannon.c9.io]
I'm just trying to get a stats windows for my game that is always fixed and from my search the only way i've found that could answer my problem is the use of the canvas tag, but i got 2 problems with it :
1- I can call the html and the canvas easily (i put it at the start of my every scene) but i run into the problem that the mouse doesn't advance the text anymore. Enter key works but not the mouse???? But the mouse work on button but once I click on it the canvas disapear! I'm scracthing my head on this one!!!
2- The other question is can i get my variable that i've already declared in TyranoScript (like [eval exp="sf.magic = '15'"]) to the canvas ? If yes how ?
Thanks guys!
This is because the mouse event layer is under your canvas layer and it's blocking the click event. Play with the "z-index" attribute of your html / canvas layer till suit your needs.
Yes, you can pass the TS variables.
I've tried [wt], [jump], and using a stop block, but I can't seem to call other tags from within an [iscript] so I'm not sure how to resume to standard game flow.
EDIT: For the time being I am using a TyranoScript block immediately following a label and checking for a running expression to prevent the game from moving forward.
one question
When you make your mini game do you simply create a scene with only the script tags to build the game?
I think I see why I been messing up. Looking at the example code above it seems to me you are creating a new window (let say pop up) outside of the page the player is currently on.
Am I getting this right?
I thought the canvas ran inside the page (scene) window. In other words when you called a enw scene insteal of loading things like text box and such you put html code in there. I take it what I should be doing is creating an HTML window (pop up) outside of hte scene for the player to play?