; e3dhsp.dll test script #include "e3dhsp3.as" #module #deffunc waitbyfps int p1, var fps E3DWaitbyFPS@ p1, fps await 0 return #global dim keybuf, 256 ;file のpath 用のバッファーの作成 pathlen = 2048 sdim pathbuf, pathlen, 2 chgdegx = 0.0 : chkdegy = 0.0 : chkdegz = 0.0 screenw = 640 : screenh = 480 screen 0, screenw, screenh, 1 pointmax = 100 title "Easy3D for HSP3 sample" ;開発中は下の行のコメントアウトを外すことを推奨します。 ;E3DEnableDbgFile ;初期化 E3DInit 0, -1, 0, 16, 0, scid1 ;カメラの初期化 camposx = 0.0 : camposy = 1500.0 : camposz = -2000.0 E3DSetCameraPos camposx, camposy, camposz camdegxz = 180.0 : camdegy = 0.0 E3DSetCameraDeg camdegxz, camdegy ;projectionの変更をしたいときは、以下の2行を有効にしてください。 proj_near = 100.0 : proj_far = 30000.0 : proj_fov = 60.0 E3DSetProjection proj_near, proj_far, proj_fov lightdirx1 = 0.0 lightdiry1 = 0.0 lightdirz1 = 1.0 lightr1 = 255 lightg1 = 255 lightb1 = 255 E3DCreateLight lid1 E3DSetDirectionalLight lid1, lightdirx1, lightdiry1, lightdirz1, lightr1, lightg1, lightb1 ; フォントの作成 ; 注意、フォント名を指定する際には、全角、半角に気を付けてください。 ; 例えば、下の例の場合、MSは全角、スペースは半角、ゴシック、明朝は全角文字です。 E3DCreateFont 20, 0, 400, 0, 0, 0, "MS ゴシック", fontid1 textdir1 = 1 textcnt1 = 0 eachcnt1 = 10 textcnt2 = 0 chkfps1 = 0 *main ; keybuf変数は、メインループの外で、dim keybuf, 256 として、確保しておいてください。 E3DGetKeyboardState keybuf if keybuf.VK_ESCAPE = 1 : goto *bye ; [ESC]で終了 gosub *MoveCamera E3DBeginScene scid1 gosub *DrawTextByFontID E3DEndScene E3DPresent scid1 waitbyfps 60, chkfps1 goto *main *bye E3DDestroyBG E3DDestroyLight lid1 E3DBye end *MoveCamera return *DrawTextByFontID textr = 255 : textg = 255 : textb = 255 textscale = 1 textposx = 10 : textposy = 0 sdim strchk1, 2048 textposy += 20 strchk1 = "徐々に、文字を表示します。逆方向への描画もOK!!\neisuuji が混じってもOK" E3DDrawTextByFontIDWithCnt scid1, fontid1, textposx, textposy, strchk1, 255, 255, 255, 255, eachcnt1, textcnt1 E3DGetCharacterNum strchk1, charanum1 if( textdir1 == 1 ){ textcnt1++ if( textcnt1 > ((charanum1 + 1) * eachcnt1) ){ textdir1 = 0 textcnt1 = (charanum1 + 1) * eachcnt1 } } else { textcnt1-- if( textcnt1 < 0 ){ textdir1 = 1 textcnt1 = 0 } } textposy += 60 strchk1 = "文字ごとに、描画タイミングを、設定できます。\n文字を、飛ばして、表示することも可能です。" E3DGetCharacterNum strchk1, charanum2 dim cntarray, charanum2 cntarray = 10, 10, 10, 10, 10, 10, 20, 25, 30, 35, 40, 45, 50, 55, 60, 90, 90, 90, 90, 90, 90, 90, 90, 90, 180, 180, 120, 120, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140 E3DDrawTextByFontIDWithCnt2 scid1, fontid1, textposx, textposy, strchk1, 255, 255, 255, 255, cntarray, charanum2, textcnt2 textcnt2++ if( textcnt2 > 300 ){ textcnt2 = 0 } textposy += 80 strchk1 = "textcnt2 " + textcnt2 E3DDrawTextByFontID scid1, fontid1, textposx, textposy, strchk1, 255, 255, 255, 255 return