Another day of updates!
You can now press enter when in the name selection box when making a file or icon in the IDE.
Added some new functions to the Map static object. Added Map.getDir(pA, pB) which will return the direction string from Diob pA to Diob pB. Also added a variable to the Map called dirs which is an array containing all the direction strings. Added Map.setLoc(pLoc, pT) which sets the tile location at pLoc to the tile pT, Map.pixelDist(pA, pB) which returns the number of pixels between pA and pB, Map.tileDist(pA, pB) which returns the number of tiles between pA and pB, and Map.getLocByDir(pL, pDir) which returns the Tile located to the direction of pDir from pL.
Added a few new features to diob.playAnimation in the form of two new arguments which let you stop the animation after it plays a certain frame and also call a function (client-side only) after the animation is over.
Added Util.isObject(pVal) which returns true if the value is an object.
Pretty big and neat feature added to the engine. You can now set an HTML img's source to a Vylocity icon by setting the src to "vyi:atlas:icon:state:frame" where each value after vyi is replaced with the proper name. For example src="vyi:someAtlas:icon1" would set the image to "icon1" instead of "someAtlas" and ignore the state and frame. You can also include a custom file with src="vyf:filename" and the actual text inside the file with src="vyf:filename:text" so you can put base64 image data in a file and load it as an image or whatever you would like.
This system also applies to urls in CSS, for example:
.someClass {
background: url('vyi:someAtlas');
}
The CSS code above would give all someClass classes a background with the main icon from the "someAtlas" atlas. You can also use this to include custom fonts. If you import a font file (somefont.ttf for our example) into the editor and then do something like:
.someClass {
font-family: 'somefont';
}
@font-face {
font-family: 'somefont';
src: url('vyf:somefont.ttf') format('truetype');
}
Our someClass class now has the custom font.
In order to use an icon atlas in CSS or HTML, it will need to be preloaded or loaded before you add the CSS or HTML. The CSS or HTML also has to be processed by the engine and can't just be included.
More updates to come!
You can now press enter when in the name selection box when making a file or icon in the IDE.
Added some new functions to the Map static object. Added Map.getDir(pA, pB) which will return the direction string from Diob pA to Diob pB. Also added a variable to the Map called dirs which is an array containing all the direction strings. Added Map.setLoc(pLoc, pT) which sets the tile location at pLoc to the tile pT, Map.pixelDist(pA, pB) which returns the number of pixels between pA and pB, Map.tileDist(pA, pB) which returns the number of tiles between pA and pB, and Map.getLocByDir(pL, pDir) which returns the Tile located to the direction of pDir from pL.
Added a few new features to diob.playAnimation in the form of two new arguments which let you stop the animation after it plays a certain frame and also call a function (client-side only) after the animation is over.
Added Util.isObject(pVal) which returns true if the value is an object.
Pretty big and neat feature added to the engine. You can now set an HTML img's source to a Vylocity icon by setting the src to "vyi:atlas:icon:state:frame" where each value after vyi is replaced with the proper name. For example src="vyi:someAtlas:icon1" would set the image to "icon1" instead of "someAtlas" and ignore the state and frame. You can also include a custom file with src="vyf:filename" and the actual text inside the file with src="vyf:filename:text" so you can put base64 image data in a file and load it as an image or whatever you would like.
This system also applies to urls in CSS, for example:
.someClass { background: url('vyi:someAtlas'); }
The CSS code above would give all someClass classes a background with the main icon from the "someAtlas" atlas. You can also use this to include custom fonts. If you import a font file (somefont.ttf for our example) into the editor and then do something like:
.someClass { font-family: 'somefont'; } @font-face { font-family: 'somefont'; src: url('vyf:somefont.ttf') format('truetype'); }
Our someClass class now has the custom font.
In order to use an icon atlas in CSS or HTML, it will need to be preloaded or loaded before you add the CSS or HTML. The CSS or HTML also has to be processed by the engine and can't just be included.
More updates to come!