簡單的Java介面展示

來源:互聯網
上載者:User

標籤:內容   string   imp   length   list   sys   tar   src   main   

 

 1 package com.barry; 2  3 import java.awt.Color; 4 import java.beans.IntrospectionException; 5 import java.lang.annotation.Repeatable; 6  7 import com.rupeng.game.GameCore;//匯入遊戲引擎包 8  9 10 //實現Runnable介面11 public class Game_RuPeng implements Runnable {12 13   public static void main(String[] args) {14       GameCore.start(new Game_RuPeng());//產生遊戲對象,並讓引擎啟動它15   }16 private Object timg;17   //覆寫介面中的run()方法,控制遊戲18   @Override19   public void run() {20       GameCore.setGameSize(1024, 640);//設定遊戲視窗大小21       GameCore.setGameTitle("馬文奇的遊戲製作");//設定遊戲視窗標題22      // GameCore.pause(1000);//設定遊戲視窗停留1秒23       GameCore.alert("listen to music 一次就好-楊宗緯");24       GameCore.loadBgView("timg.jpg");25       GameCore.playSound("一次就好-楊宗緯-1774946504.mp3", true);26       GameCore.pause(15000);//設定遊戲視窗停留15秒27       GameCore.loadBgView("aa.jpg");28       GameCore.pause(3000);//設定遊戲視窗停留3秒29       GameCore.alert("listen to music Try Everything");30       GameCore.playSound("TriGO! - Try Everything.mp3", true);31       GameCore.pause(20000);32       boolean b = GameCore.confirm("你覺得好聽嗎?");33       if(b)34           GameCore.alert("你的回答是好聽");35       else36           GameCore.alert("你回答的是不好聽");37       38       String n1 = GameCore.input(null, "請輸入一個數字");39       String n2 = GameCore.input(null, "請再輸入一個數字");40       41       if(n1.length()<=0||n2.length()<=0) {42           GameCore.alert("輸入內容不正確,即將退出");43           GameCore.pause(3000);44           45       }else {46           GameCore.alert("兩個個數位和是:" + (Integer.parseInt(n1) + Integer.parseInt(n2)));47       }48       GameCore.createText(0,"馬文奇");49       GameCore.createText(1,"NO PAINS NO GAINS");50       GameCore.setTextPosition(0, 100, 100);51       GameCore.setTextPosition(1, 100, 200);52       GameCore.setTextColor(0, Color.BLUE);53       GameCore.setTextColor(1,new Color(255,3,3));54       GameCore.setTextFontSize(0, 30);55       GameCore.setTextFontSize(1, 18);56       if(GameCore.confirm("你想要隱藏文字標籤?")) {57           GameCore.hideText(0);58           GameCore.hideImage(1);59       }else {60           System.exit(0);61       }62       GameCore.alert("來一張圖");63       GameCore.createImage(0, "美女.jpg");64       GameCore.setImagePosition(2,400,200);65       66       GameCore.createImage(1);67       GameCore.setImagePosition(4, 500, 500);68       69       GameCore.alert("顯示出來");70       GameCore.setImageSource(1, "戰狼2.jpg");71       GameCore.pause(100000);72           73       }74 75      76   }

 

 

 

 

 

簡單的Java介面展示

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.