在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:MrSoya/soya2d开源软件地址:https://github.com/MrSoya/soya2d开源编程语言:JavaScript 100.0%开源软件介绍:Soya2D is a web interactive animation(game) engine for modern web browsers Version2 is in beta nowEntry<script>
//define scene
var scene = {
onPreload:function(game){
//set scale mode
game.stage.scaleMode = soya2d.SCALEMODE_NOSCALE;
//set align mode
game.stage.alignMode = soya2d.ALIGNMODE_CENTER;
//load assets
game.load.baseUrl = 'assets/image/';
game.load.image(['soya.png','logo.png']);
game.load.atlas({'imgFont':['font.png','font.ssheet']});
game.load.baseUrl = 'assets/xml/';
game.load.xml({
ui:'ui.xml'
});
},
onInit:function(game){
//set background
game.stage.background('#000');
//apply ui
this.setView(game.assets.xml('ui'));
//add a text to world
game.add.text({
text:'Hello Soya2D',
font:game.assets.atlas('imgFont')//use image font
});
}
}
//render all
soya.render('#stage',1024,768,scene);
</script> WebsiteLocal Examples
Gen API doc
Licensebase on MIT |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论