-
ching8885
-
- 文章: 36
- 註冊時間: 2006-11-24 1:12 pm
- 來自: 香港
由 ching8885 » 2007-04-22 4:25 am
1,如何自動限制角色圖示顯示大小?
因為讓玩家能自選頭像
所以想在WOG.js顯示角色,冠軍及他人狀態時,方便排版,讓程式自動重設顯示圖片大小
已解決 開啟WOG.JS 寫:在 function status_view 及 function status_view2 找尋: - 代碼: 選擇全部
if(p_img_set==1) { p_img=i_img; }else { p_img=img+i_img+".gif"; }
下方加上: - 代碼: 選擇全部
var p_width=0; var p_height=0; var i_limit = 200; //你想限制的長闊 var Pimg = new Image(); Pimg.src=p_img; p_width=Pimg.width; p_height=Pimg.height; if(p_width > p_height) { if(p_width > i_limit) { p_height = Math.floor(p_height * i_limit/p_width) ; p_width = Math.floor(p_width * i_limit/p_width) ; } } if(p_height > p_width) { if(p_height > i_limit) { p_width = Math.floor(p_width * i_limit/p_height) ; p_height = Math.floor(p_height * i_limit/p_height) ; } }
找尋: - 代碼: 選擇全部
f.write('<tr><td rowspan="8" >'+p_group+'<br><img src="'+p_img+'" border="0" ><br>')
改成: - 代碼: 選擇全部
f.write('<tr><td rowspan="8" >'+p_group+'<br><img src="'+p_img+'" height="'+p_height+'" width="'+p_width+'" border="0" ><br>')
2.想到一個顯示物攻,物防,魔攻,魔防的方式
如圖:
這個應該比較複雜...完全沒有頭緒...
但是感覺這樣顯示很獨特,希望能夠實現
3.想將角色登入按鈕設定成登入後便disable,可以嗎?
======================================================[quote="涅魂"]<u>積分 +3</u>
分享修改
[/point]
最後由 ching8885 於 2007-04-30 2:06 am 編輯,總共編輯了 2 次。
-
ching8885
-
- 文章: 36
- 註冊時間: 2006-11-24 1:12 pm
- 來自: 香港
由 ching8885 » 2007-04-24 10:02 am
更新了兩個問題...希望能夠實現得到
-
齋月
-
- 文章: 557
- 註冊時間: 2006-02-27 7:54 am
由 齋月 » 2007-04-24 12:06 pm
第一個不懂.....
第二個也不懂.....
XD
第二個感覺要用flash做 @@?
-
ching8885
-
- 文章: 36
- 註冊時間: 2006-11-24 1:12 pm
- 來自: 香港
由 ching8885 » 2007-04-24 1:53 pm
如果有繪圖函式的話
只要計出四個數值的坐標
然使用繪圖的函式把四點連起甚至填滿便行了
-
簫哥
-
- 文章: 629
- 註冊時間: 2006-04-01 9:08 pm
- 來自: 戰略電玩
- 性別: 男生
由 簫哥 » 2007-04-24 3:30 pm
第二個問題,好像在那裡見過了,阿!就是php版ebs(無盡的戰鬥),簡單是phpeb,我曾經下載看看,不過沒有研究顯示變數的程式= =!!
別再給涅魂一推麻煩,做不到就說了建議吧!好像有問沒答...
該死的時間,一天行程滿檔了。
-
ching8885
-
- 文章: 36
- 註冊時間: 2006-11-24 1:12 pm
- 來自: 香港
由 ching8885 » 2007-04-24 3:59 pm
對呀....就是幾年前玩過ebs...
突然靈機一閃想到把它用到WOG中
-
涅魂
-
- 文章: 4463
- 註冊時間: 2004-01-04 11:17 am
- 來自: Taiwan
- 性別: 男生
由 涅魂 » 2007-04-24 9:33 pm
第一個問題用載入圖檔即可解決,好像在解決呀成的戰鬥圖片顯示問題時有用上
寫法大致如下
- 代碼: 選擇全部
var Ipic=new Image(); Ipic.src=...;
至於第二個問題嘛…這個有點難度^^"
若用PHP的話可以用GD函數簡單地畫出您要的內容,但若只使用JavaScript來寫, 或許可以寫得出來
我列出我想到的方法
1.設定maxvalue
2.取得能力比例
3.定義二維座標
4.取得兩兩間距
5.反三角求出tan[sup]-1[/sup]的值後用濾鏡旋轉再伸縮(也可用矩陣?)
大致上應該是這樣的寫法,不過這不是很好寫,要傷頭腦的話等週末再來傷吧...^^"
-
ching8885
-
- 文章: 36
- 註冊時間: 2006-11-24 1:12 pm
- 來自: 香港
由 ching8885 » 2007-04-24 9:46 pm
- 代碼: 選擇全部
var Ipic=new Image(); Ipic.src=...;
即是如何取長及闊呀.....?
img_W=Ipic.Width <<?
img_W=Ipic.GetWidth <<?
取值語法是甚麼
-
涅魂
-
- 文章: 4463
- 註冊時間: 2004-01-04 11:17 am
- 來自: Taiwan
- 性別: 男生
由 涅魂 » 2007-04-24 9:54 pm
寬用width,高用height,像這樣
- 代碼: 選擇全部
var Iwidth=Ipic.width,Iheight=Ipic.height;
-
ching8885
-
- 文章: 36
- 註冊時間: 2006-11-24 1:12 pm
- 來自: 香港
由 ching8885 » 2007-04-24 9:59 pm
謝謝,會努力試試看~
-
ching8885
-
- 文章: 36
- 註冊時間: 2006-11-24 1:12 pm
- 來自: 香港
由 ching8885 » 2007-04-24 11:03 pm
- 代碼: 選擇全部
function status_view(p_win,p_lost,p_img_set,i_img,p_sex,p_s,p_lv,p_exp,p_nextexp,p_money,p_hp,p_hpmax,p_str,p_smart,p_agl,p_life,p_vit,p_au,p_be,p_at,p_mat,p_df,p_mdf,p_place,p_luck) { var f=parent.wog_view.document; var p_img=""; var scale=0; var p_width=0,p_height=0,Pimg = new Image(); if(p_img_set==1) { p_img=i_img; }else { p_img=img+i_img+".gif"; } f.write(temp_table1); Pimg.src=p_img; p_width=Pimg.width; p_height=Pimg.height; if(p_width>p_height) { if(p_width > 200) { scale = parseInt(200/p_width) ; p_width = Math.floor(p_width * scale) ; p_heidth = Math.floor(p_heidth * scale) ; } else { if(p_heidth > 200) { scale = parseInt(200/p_heidth); p_width = Math.floor(p_width * scale) ; p_heidth = Math.floor(p_heidth * scale) ; } } 略... f.write('<tr><td rowspan="8" >公會︰'+p_group+'<br>頭銜︰'+p_style+'<br><img src="'+p_img+'" height="'+p_height +'" width='"+p_width+'" border="0" ><br>') 下略....
不知錯些甚麼呢...
-
齋月
-
- 文章: 557
- 註冊時間: 2006-02-27 7:54 am
由 齋月 » 2007-04-25 7:15 am
涅魂 寫:第一個問題用載入圖檔即可解決,好像在解決呀成的戰鬥圖片顯示問題時有用上 寫法大致如下 - 代碼: 選擇全部
var Ipic=new Image(); Ipic.src=...;
至於第二個問題嘛…這個有點難度^^" 若用PHP的話可以用GD函數簡單地畫出您要的內容,但若只使用JavaScript來寫, 或許可以寫得出來 我列出我想到的方法 1.設定maxvalue 2.取得能力比例 3.定義二維座標 4.取得兩兩間距 5.反三角求出tan[sup]-1[/sup]的值後用濾鏡旋轉再伸縮(也可用矩陣?) 大致上應該是這樣的寫法,不過這不是很好寫,要傷頭腦的話等週末再來傷吧...^^"
連三角函數都出來了阿0.0 微積分三角函數篇 有夠難的 =.=|||
常常 y' & y" 求錯 OTZ.....
以上堤外話XD
-
涅魂
-
- 文章: 4463
- 註冊時間: 2004-01-04 11:17 am
- 來自: Taiwan
- 性別: 男生
由 涅魂 » 2007-04-25 11:32 pm
ching8885 寫:- 代碼: 選擇全部
function status_view(p_win,p_lost,p_img_set,i_img,p_sex,p_s,p_lv,p_exp,p_nextexp,p_money,p_hp,p_hpmax,p_str,p_smart,p_agl,p_life,p_vit,p_au,p_be,p_at,p_mat,p_df,p_mdf,p_place,p_luck) { var f=parent.wog_view.document; var p_img=""; var scale=0; var p_width=0,p_height=0,Pimg = new Image(); if(p_img_set==1) { p_img=i_img; }else { p_img=img+i_img+".gif"; } f.write(temp_table1); Pimg.src=p_img; p_width=Pimg.width; p_height=Pimg.height; if(p_width>p_height) { if(p_width > 200) { scale = parseInt(200/p_width) ; p_width = Math.floor(p_width * scale) ; p_heidth = Math.floor(p_heidth * scale) ; } else { if(p_heidth > 200) { scale = parseInt(200/p_heidth); p_width = Math.floor(p_width * scale) ; p_heidth = Math.floor(p_heidth * scale) ; } } 略... f.write('<tr><td rowspan="8" >公會︰'+p_group+'<br>頭銜︰'+p_style+'<br><img src="'+p_img+'" height="'+p_height +'" width='"+p_width+'" border="0" ><br>') 下略....
不知錯些甚麼呢...
數值計算完後要記得指定給圖片物件,不然您計算得多費時也是枉然... 齋月 寫:連三角函數都出來了阿0.0 微積分三角函數篇 有夠難的 =.=||| 常常 y' & y" 求錯 OTZ.....
以上堤外話XD
我還沒學到三角函數的微分呢,目前只學到函數的微分,所以看不懂XD
不過這裡應該是用不到微分吧,這用程式寫好像不太好寫…Orz
-
ching8885
-
- 文章: 36
- 註冊時間: 2006-11-24 1:12 pm
- 來自: 香港
由 ching8885 » 2007-04-26 1:06 am
仔細一看,原來有不少地方打錯字
而致命的是IF 少了一個 "}"
哈哈...我太大意了
-
涅魂
-
- 文章: 4463
- 註冊時間: 2004-01-04 11:17 am
- 來自: Taiwan
- 性別: 男生
由 涅魂 » 2007-04-26 8:17 pm
呵呵,加油吧,失敗是成功之母
|