Cloudsx Posted May 8, 2006 Share Posted May 8, 2006 last week or 2 week ago i ask if some one could help me making a gui2create button i got this code Global $Pic1 = 100000000000000000 $main = GUICreate('') $button = GUICtrlCreateButton("Create Pic Button", 10, 10, 100, 30) GUISetState() While 2 $msg = GUIGetMsg() If $msg = $button Then $Pic1 = GUICtrlCreatePic(@MyDocumentsDir "here your pic location", 10, 100, 100, 30) EndIf If $msg = $Pic1 Then MsgBox(0, 'Works', 'You clicked the button pic') EndIf WEnd i have try to place it in my script but it does't work ad all no kick so can somebody help me to place it in my script here is my script expandcollapse popup#include <GUIconstants.au3> $Player=IniRead("Player.ini", "Player", "PlayerName","NotSet"); Reads the player from the ini file ;if the ini file does not exist or no entry then load the file open dialogue. If $Player = "NotSet" then MsgBox(4096,"Choose your picture", "choose you picture you want to use for the game") $Player=FileOpenDialog ("choose your picture","C:\","(*.*)") EndIf IniWrite ("Player.ini", "Player", "PlayerName", $Player);write the player back to the ini file $main_GUI = GUICreate ("elcaponis" ,400,400) GUISetState(@SW_SHOW) GUICtrlCreatePic ($Player,25,70,64,64);you should be adjust at size your image $exp = IniRead("Exp.ini", "Exp", "Exp",0) $Lvl = IniRead("Exp.ini", "Lvl", "Lvl",0) $TNL = IniRead("Exp.ini", "TNL", "TNL",0) $HP = IniRead("HP.ini", "HP","HP",0) $MP = iniRead("MP.ini", "MP","MP",0) GUICtrlCreateLabel("Exp", 25,15, 25,25) $exp = GuiCtrlCreateLabel($exp,50,15) GUICtrlCreateLabel("Lvl", 70,15,25,25) $Lvl = GUICtrlCreateLabel($Lvl,95,15) GUICtrlCreateLabel("Tnl", 120,15,25,25) $TNL=GUICtrlCreateLabel($TNL,145,15) GUICtrlCreateLabel("HP:",30,150,25,25) $HP=GUICtrlCreateLabel($HP,50,150) GUICtrlCreateLabel("MP:",30,175,25,25) $MP=GUICtrlCreateLabel($Mp,50,175) if $exp > 50 Then $Lvl + 1 if $exp > 50 Then $HP + 12 if $exp > 50 then $MP + 6 if $exp > 120 then $Lvl + 1 if $exp > 120 then $HP + 12 if $exp > 120 then $mp + 6 if $exp > 290 then $Lvl + 1 if $exp > 290 then $HP + 12 If $exp > 290 then $mp + 6 If $exp > 630 Then $Lvl + 1 if $exp > 630 then $HP + 12 if $exp > 630 then $MP + 6 Opt("GUICoordMode",4) $Hunt=GUICtrlCreateButton("Hunt",200, 350, 40,40) $status=GUICtrlCreateButton("Status",25,200,40,40) While 1 $msg = GUIGetMsg($main_GUI) If $msg = $GUI_EVENT_CLOSE Then If WinActive("elcaponis") then Exit If WinActive("Hunt") then GUIDelete($Hunt) If WinActive("Status") then GUIDelete($status) EndIf If $msg = $hunt then Gui2create() if $msg = $status then Gui3create() Wend func Gui2create() If WinExists("Hunt") then Return $Hunt = GUICreate("",100,100,700,550) GUISetBkColor(0x49bf49) $button = GUICtrlCreatePic("Blood Hund.jpg",18,18 ,64,64) GUISetState (@SW_SHOW) EndFunc Func Gui3create() if WinExists("Status") then Return $status= GUICreate("Status",300,200,200,200) GUISetBkColor(0xB7B7B7) GUISetState(@SW_SHOW) EndFunc thanks you Cloudsx Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now