摘要: 1 package 2 { 3 import away3d.textures.*; 4 import away3d.tools.helpers.*; 5 import away3d.animators.data.*; 6 import away3d.animators.nodes.*; 7 import away3d.animators.*; 8 import away3d.materials.lightpickers.*; 9 import away3d.materials.methods.*; 10 im... 阅读全文
posted @ 2013-05-06 00:09 Kinel 阅读(1440) 评论(0) 推荐(0) 编辑
摘要: 1 package 2 { 3 import away3d.tools.helpers.*; 4 import away3d.animators.data.*; 5 import away3d.animators.nodes.*; 6 import away3d.animators.*; 7 import away3d.materials.lightpickers.*; 8 import away3d.materials.methods.*; 9 import away3d.*; 10 import away... 阅读全文
posted @ 2013-05-01 12:00 Kinel 阅读(687) 评论(1) 推荐(0) 编辑
摘要: 1 package 2 { 3 import away3d.materials.lightpickers.StaticLightPicker; 4 import flash.display.*; 5 import flash.events.*; 6 import flash.ui.*; 7 import flash.ui.*; 8 9 import away3d.*; 10 import away3d.entities.*; 11 import away3d.materials.*; 12 ... 阅读全文
posted @ 2013-04-30 19:27 Kinel 阅读(491) 评论(0) 推荐(0) 编辑
摘要: 1 package 2 { 3 import away3d.entities.*; 4 import away3d.materials.*; 5 import away3d.primitives.*; 6 import away3d.utils.*; 7 import flash.display.*; 8 import flash.events.*; 9 import away3d.containers.*;10 import flash.ui.ContextMenu;11 import flash.ui.Contex... 阅读全文
posted @ 2013-04-30 12:53 Kinel 阅读(347) 评论(0) 推荐(0) 编辑
摘要: 本文转自:http://www.cnblogs.com/whiteyun/archive/2009/09/02/1541043.html在string库中功能最强大的函数是:string.find(字符串查找)string.gsub(全局字符串替换)string.gfind(全局字符串查找)string.gmatch(返回查找到字符串的迭代器)这些函数都是基于模式匹配的。与其他脚本语言不同的是,Lua并不使用POSIX规范的正则表达式[4](也写作regexp)来进行模式匹配。主要的原因出于程序大小方面的考虑:实现一个典型的符合POSIX标准的regexp大概需要4000行代码,这比整个Lua 阅读全文
posted @ 2012-08-05 15:02 Kinel 阅读(675) 评论(0) 推荐(0) 编辑
摘要: lua中有一个全局的表,_G,这个表包含了所有的全局变量.例如:a = 123;d = {a,444};这样的两个变量实际上就会被lua存储到_G表中去.也就是说_G["a"]就是变量a._G["a"] = _G["d"];这样的语句和a=d;是完全一样的.当然,既然_G也是一个表,那么我们就可以设置_G表的__index等函数来达到控制_G表的访问权限了.当然我们也可以用__newindex来防止创建新的全局变量(至于怎么做:只要在函数里调用error()函数来输出一个错误就行了,这样就可以避免创建新的全局变量,但是一般没必要这么做 阅读全文
posted @ 2012-08-05 14:21 Kinel 阅读(5572) 评论(0) 推荐(0) 编辑
摘要: table是lua中的唯一的一个数据结构.而且,table中的数据可以是任意类型的,当然也可以是函数类型.例如:a = {};-->声明一个tablea[1] = function() print("a"); end; -->这样就给a[1]赋予了一个函数.也就是说,table里可以存储各种各样的东西.同时如果a[2] = a;-->这也是可行的,但是注意,lua中的这种赋值用法得到的结果其实是: a[2]是a的引用,而并非把a的内容都复制给a[2].也就是说,一个table中既可以有数据,也可以有函数.而Metatables(元表)其实也是一个table 阅读全文
posted @ 2012-08-05 13:49 Kinel 阅读(339) 评论(0) 推荐(0) 编辑
摘要: Lua的语法实际上和c的语法很接近,看起来也比较的简洁.(Lua5.1版本)Lua的关键字如下: and break do else elseif end false for function if in local nil not or repeat return then true until whileLua的基本符号如下: + - * / % ^ # == ~= <= >= < > = ( ) { } [ ] ; : ... 阅读全文
posted @ 2012-08-04 13:19 Kinel 阅读(2499) 评论(0) 推荐(0) 编辑
摘要: HGE本身并不支持中文的显示,因此我使用由 微妙的平衡 大神提供的解决方案.大神提供的代码本来包含gfxfont.h和gfxfont.cpp文件,只需要将这两个文件添加到工程中即可使用.但是我实在太懒,为了避免每次都添加两个文件到工程中去,于是我擅自将cpp的代码全部移到了.h文件中并做了一些细微的改动.这样每次使用的时候就只需要将gfxfont.h引入工程就够了,当然我把这个gfxfont.h直接放到了hge的include文件夹中,这样我就可以直接用#include <gfxfont.h>来引用这个文件了.(当然,要先hge的include目录添加到工程中去.)以下是gfxfo 阅读全文
posted @ 2012-08-02 20:04 Kinel 阅读(1576) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 ** Haaf's Game Engine 1.8 3 ** Copyright (C) 2003-2007, Relish Games 4 ** hge.relishgames.com 5 ** 6 ** hge_tut08 - The Big Calm 7 */ 8 9 10 // 复制"font2.fnt","font2.png","objects.png" 11 12 13 // 本教程模拟了太阳和月亮的运转,以及天空和海面的情况 14 15 16 #include <math.h> 17 1 阅读全文
posted @ 2012-08-01 16:39 Kinel 阅读(8768) 评论(0) 推荐(0) 编辑