2019年6月27日 星期四

facebook 即時遊戲 本機端測試


即時遊戲 本機端測試需要二個東西
1.透過 npm安裝 http-server 套件


npm install -g http-server

2.SSL



下載openSSL
https://slproweb.com/products/Win32OpenSSL.html

我的是win7所以下載檔案
Win64 OpenSSL v1.1.0k

安裝完會在C:\OpenSSL-Win64\bin
openssl.exe

接下來在




cd path/to/my/game/
openssl genrsa 2048 > key.pem
openssl req -x509 -days 1000 -new -key key.pem -out cert.pem

 Country Name (2 letter code) [AU]:TW                                                   //國碼臺灣是 TW
 State or Province Name (full name) [Some-State]:Taiwan R.O.C                           //國名臺灣填 Taiwan
 Locality Name (eg, city) []:Taipei                                                     //地名
 Organization Name (eg, company) [Internet Widgits Pty Ltd]:FreeBSD Personal Reserach   //組織單位名稱
 Organizational Unit Name (eg, section) []:FreeBSD Personal Reserach                    //部門名稱
 Common Name (eg, YOUR name) []:www.weithenn.org                                        //憑證的名稱 (通常為伺服器 FQDN)
 Email Address []:weithenn@weithenn.org                                                 //申請單位的聯絡信箱
 Please enter the following 'extra' attributes
 to be sent with your certificate request
 A challenge password []: 按 Enter 直接跳過                                             //申請書的密碼
 An optional company name []: 按 Enter 直接跳過                                         //憑證代辦公司的名稱

http-server --ssl -c-1 -p 8080 -a 127.0.0.1


https://www.facebook.com/embed/instantgames/YOUR_GAME_ID/player?game_url=https://localhost:8080/index.html


FBInstant.getLocale()
//zh_TW

getLocale
getPlatform
getSDKVersion
getSupportedAPIs
getEntryPointData
player.getID
player.getName
player.getPhoto
context.getID
context.getType
context.isSizeBetween
logEvent
onPause
inventory.unlockItemAsync
matchPlayerAsync
initializeAsync
setLoadingProgress
setSessionData
startGameAsync
player.flushDataAsync
player.getDataAsync
player.setDataAsync
player.subscribeBotAsync
player.getConnectedPlayersAsync
player.getSignedPlayerInfoAsync
context.switchAsync
context.chooseAsync
context.createAsync
context.getPlayersAsync
shareAsync
switchGameAsync
quit
getEntryPointAsync
getLeaderboardAsync
checkCanPlayerMatchAsync
context.isPublicAsync
player.canSubscribeBotAsync
player.getStatsAsync
player.setStatsAsync
player.incrementStatsAsync
postSessionScore
referrals.getCountAsync
updateAsync

2014年6月4日 星期三

改變chrome 開發工具的樣式


Step1 先選擇一套你想安裝的樣式安裝
Flatland
Zero Dark Matrix
Dracula 

Step2在網址列上輸入
chrome://flags/#enable-devtools-experiments
啟用開發人員工具實驗性功能,選擇啟用並重開chrome

Step3打開開發工具裡的設定
Experiments
同意Allow custom UI themes
關畢開發工具再打開就改變了

在Edge Code 裡使用Brackets擴充

step1:打開設定檔config.json

 路徑在:C:\Program Files (x86)\Adobe\Adobe Edge Code CC\www

step2:加入以下code

//將以下code
"extension_registry": "https://s3.amazonaws.com/extend.brackets/registry.json",
"extension_url": "https://s3.amazonaws.com/extend.brackets/{0}/{0}-{1}.zip"


//加至底 "config": { "app_title": "Adobe Edge Code CC (Preview)", "app_name_about": "Adobe® Edge Code CC", "about_icon": "styles/images/code_app.svg", "enable_jslint": false, "how_to_use_url": "http://www.adobe.com/devnet/edge-code/articles/code-editing-with-edge-code.html", "forum_url": "http://adobe.com/go/edge_code_forum", "release_notes_url": "http://adobe.com/go/edgecode_releasenotes", "report_issue_url": "", "twitter_url": "https://twitter.com/edge_code", "troubleshoot_url": "http://forums.adobe.com/docs/DOC-3027", "twitter_name": "@edge_code", "contributors_url": "https://api.github.com/repos/adobe/brackets/contributors", "extension_wiki_url": "https://github.com/adobe/brackets/wiki/Brackets-Extensions", // "extension_registry": "https://s3.amazonaws.com/extend.brackets/registry.json", "extension_url": "https://s3.amazonaws.com/extend.brackets/{0}/{0}-{1}.zip" }

 step3:重新開啟 Edge Code 完成!!


在擴充裡會出現available的頁籤,就看您想裝那個嚕~~~happy coding!!!




資料來源

2010年8月19日 星期四

使用rotationX, rotationY, rotationY or z =0;圖文會有點糢糊

DisplayObject使用rotationX,rotationY,rotationY或z屬性後,即使把他設定為0,圖文會有點糢糊現像。
修正方法:
DisplayObject.transform.matrix = new Matrix( );

2010年7月20日 星期二

FDT 使用ANT建立progression html

ANT的檔案是XML格式,每個檔案都有個project,project裡有多個target就是你一系列想要執行的任務。
而建立html主要是復製一個template.html,並將內容做修改
//Build.XML 


//先把index.template.html檔案復製到專案資料夾裡的bin裡,重新命名為index.html
  

//將index.html檔案裡的${title}替換

 


//index.template.html
//這檔案裡在title裡加入${title}是給ANT替換用

FDT_ANT_progression4Demo.zip

2010年7月18日 星期日

FDT progression4 templates

windows==>preferences==>FDT==>Editor==>Templates
點選import匯入progression4templates.xml

progression4templates.zip

使用時Alt+/再按p鍵可以看到如下圖:




選擇你要的template就會自已貼上

2010年7月11日 星期日

AS3 RSS應用(xmlsyndication.swc)

我們常在全flash網頁上看到的最新消息都只是另開一個新的視窗,連結到blog,而不把內容做在flash裡,要用AS寫出這樣的功能是沒問題的,但單單只是要做到這樣功能,會需要用到資料庫來存取資訊,在維護上如果要做到簡便,會需要多寫個後台來管理,所需的人力時間成本相當的高,如果是採用把最新消息導到blog,直接使用blog的功能,可以達到方便更新又省時省人力,只需多出一個blog版型

Blog都會提供RSS資料,可以透過xmlsyndication.swc方便取得所要資訊。

以下是主要程式碼:

import com.adobe.xml.syndication.rss.Item20;
 import com.adobe.xml.syndication.rss.RSS20;

 import flash.display.MovieClip;
 import flash.events.Event;
 import flash.net.URLLoader;
 import flash.net.URLRequest;

 /**
  * @author georgelynch
  */
 public class RSSDemo extends MovieClip 
 {
  //- PRIVATE & PROTECTED VARIABLES -------------------------------
  private var _RSSFeedURL : String = "http://georgeeeeeeeeee.blogspot.com/feeds/posts/default?alt=rss";
  private var _RSS2 : RSS20;
  private var _ldr : URLLoader;

  //- PUBLIC & INTERNAL VARIABLES --------------------------------
  //- CONSTRUCTOR ------------------------------------------------
  public function RSSDemo()
  {
   _ldr = new URLLoader();
   _ldr.addEventListener(Event.COMPLETE, loadCompleteHandler);
   _ldr.load(new URLRequest(_RSSFeedURL));
  }

  private function loadCompleteHandler(event : Event) : void 
  {
   _RSS2 = new RSS20();
   
   _RSS2.parse(URLLoader(event.target).data);
   var items : Array = _RSS2.items;
   for each(var item:Item20 in items)
   {
    trace('item.title: ' + (item.title));
    trace('item.link: ' + (item.link));
   }
  }
 }

範例下載:RSSDemo.rar

下載SWC:xmlsyndication.swc