ä¼¼éScenarioTextDraw
yaneSDK4Csã®ãã°ä¿®æ£ããã£ã¦ãããã¡ãã£ã¨ã²ã¼ã ããã°ã©ãã³ã°ã£ã½ããã¨ããããªã£ãã®ã§ãã©ã¤ãã©ãªæ¡å¼µãã¦ããã¹ã表示ã§HTMLã£ã½ãã¿ã°ã使ããããã«ãã¦ã¿ã¾ããããããªæãã§ä½¿ãã¾ãã
using System; using y4cs.timer; using y4cs.math; using y4cs.aux; using y4cs.draw; using y4cs.input; class Sample01 { // ãã¹ãæåå static string text = "<font size=2 color=#ffffff>" + "<b>ãããããããããã¤ãã«è¦ã¤ãããã</b><br>" + " <br>" + "<font size=3 color=#00ff00>森</font>ã¨<font color=#0000ff size=3>æ¹</font>" + "ã«å²ã¾ãã<u>å¤åã®ä¸å®¤</u>ã§<font size=3 color=#ff0000>女</font>ã¯åããã<br>" + "çã£æãªé¨å±ã®ä¸ã<br>" + "<b><font color=#add8e6>è¼ãæ</font></b>ã®å ãæµ®ãã³åºãã·ã«ã¨ããã<br>" + "ç´ç½ã®ãã¬ã¹ã¨<b><font color=#e0ffff>ç½ãè</font></b>ã" + "ããã¦<b><font color=#ff0000>æ·±ç´ ã®ç³</font></b>ãæéã«å ã£ã¦ããã<br>" + " <br>" + "<b>ãéã®å¥³çâ¦ãæ æ°ãªè²´æ¹ã¨ã¯ãããæ²é»ãã¦<i>ï¼ï¼å¹´</i>ã<br>" + "ãå°ã æ ãããã§ã¯ãªãã¦ï¼ã</b><br>" + " <br>" + "<font size=3 color=#ff0000>女</font>ã¯æ±ã®çªã¸ã¨è¶³ãé²ããã<br>" + "ãã®ç©ºã®åããã«<u><i>彼女</i></u>ãããã<br>" + "åªããè¦ã¤ããç®ãç´°ããããå³ãããã®ã«å¤ããã<br>" + " <br>" + "<b>ãè²´æ¹ã«ç¡æ§ãªå§¿ã¯è¨±ãããªãã®ãã" + "<font color=#ffd700><i><u>ã¢ã¿ãã·ã¢</u></i></font>ã</b></font>"; [STAThread] static void Main(string[] args) { // ã決ã¾ãã®ãã¿ã¼ã³ Screen screen = new Screen(); screen.beginScreenTest(); screen.testVideoMode(640,480,0); screen.endScreenTest(); // ã¢ã«ãã¡è»¢éãã screen.blendSrcAlpha(); // 60fps FpsTimer fpstimer = new FpsTimer(); fpstimer.setFps(60); // ãã©ã³ããã¼ãã¼ã«ä½¿ç¨ãããã©ã³ããç»é² // registerã§ç»é²ããå ´åãç»é²é ã«0,1...ã¨çªå·ãæ¯ããã // ãã®çªå·ãFontRepositoryã®setLoaderãå¼ã¶ã¨ãã«æå®ãã FontLoader loader = new FontLoader(); for (int i = 0; i < 3; ++i) { loader.register("msmincho.ttc", 16 + i * 4); // MSææ } int loop = 0; MouseInput m = new MouseInput(); // HTMLå½¢å¼ã«å¯¾å¿ããããã¹ãæç»ã¯ã©ã¹ ScenarioTextDraw view = new ScenarioTextDraw(); view.getFontRepository().setLoader(loader, 0); view.getFontRepository().setMax(300); // HTMLå½¢å¼ã®æååãè¨å® view.setText(text); view.updateText(); Color4ub c = new Color4ub(); while (GameFrame.pollEvent() == 0) { // ãã¦ã¹ã¯ãªãã¯ã§çµäº if (m.isPress(MouseInput.button.left)) break; screen.clear(); // 10ãã¬ã¼ã æ¯ã«1æå表示 if (loop++ % 10 == 0) view.next(); view.onDraw(screen, 30, 30, c); screen.update(); fpstimer.waitFrame(); } } }
ããå°ãããã¹ããããã©ã¤ãã©ãªãã¢ãããã¾ãã