CRoW,,# Posted March 14, 2013 Share Posted March 14, 2013 (edited) السلام عليكم بغيت اذا ضغطت على زر تتغير الخلفية واذا ضغط مرة ثانية ترجع الخلفية الاولى وهكذا Edited March 14, 2013 by Guest Link to comment
iPrestege Posted March 14, 2013 Share Posted March 14, 2013 guiStaticImageLoadImage لازم تكون مسوي صورة من قبل # Link to comment
CRoW,,# Posted March 14, 2013 Author Share Posted March 14, 2013 local wnd = guiCreateStaticImage ( 0.45, 0.48, 0.2, 0.5, "1.png", true ) setTimer ( guiStaticImageLoadImage, 10000, 1,wnd , "2.png" ) كذا تقريبا نفس مثال الويكي Link to comment
iPrestege Posted March 14, 2013 Share Posted March 14, 2013 تبية اذا ضغط زر يغير الصورة wnd? Link to comment
CRoW,,# Posted March 14, 2013 Author Share Posted March 14, 2013 تبية اذا ضغط زر يغير الصورة wnd? يب..! بحطه على اسم الزر Link to comment
iPrestege Posted March 14, 2013 Share Posted March 14, 2013 addEventHandler("onClientGUIClick",Button, function ( ) guiStaticImageLoadImage ( wnd, "اسم الملف.png" ) end,false) Link to comment
yazan Posted March 14, 2013 Share Posted March 14, 2013 طيب مو المفروض يكون عامل صوره 1 ترو و صوره 2 فوقها فلس و لمن يكبس يعكس الامر ذا قصده Link to comment
CRoW,,# Posted March 14, 2013 Author Share Posted March 14, 2013 طيب مو المفروض يكون عامل صوره 1 ترو و صوره 2 فوقها فلس و لمن يكبس يعكس الامر ذا قصده يب اقصد كذا يعني العملية عكسية Link to comment
iPrestege Posted March 14, 2013 Share Posted March 14, 2013 addEventHandler("onClientGUIClick",Button, function ( ) guiStaticImageLoadImage ( wnd, "اسم الملف.png" ) end,false) هذا الكود يوم تضغط زر ومسوي صورة بـ اسم wnd بيغيرها لـ صورة ثانية كذا صح؟ يوم تضغط زر Button بيغير الصورة ذذ مثلا حط اي ملف وغيرها وجرب # Link to comment
yazan Posted March 14, 2013 Share Posted March 14, 2013 شوف ذا نفس الودك ياه لو ما عارفت تعمل اطرح كلنت حقك و اعمله لك لكن لزم صوره 1 و 2 نفس احداث المكان GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(285,15,249,509,"للل",false) guiSetVisible(GUIEditor_Window[1],false) guiSetAlpha(GUIEditor_Window[1],1) GUIEditor_Image[1] = guiCreateStaticImage(13,49,87,390,"yazan/jo1.png",false,GUIEditor_Window[1]) GUIEditor_Image[2] = guiCreateStaticImage(13,49,87,390,"yazan/jo2.png",false,GUIEditor_Window[1]) guiSetVisible(GUIEditor_Image[2],false) Button1 = guiCreateButton(9,451,231,48,"yaZan",false,GUIEditor_Window[1]) function open() guiSetVisible(GUIEditor_Window[1],not guiGetVisible(GUIEditor_Window[1])) showCursor(guiGetVisible(GUIEditor_Window[1])) guiSetInputEnabled(guiGetVisible(GUIEditor_Window[1])) end bindKey("F6","down",open) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == Button1 ) then guiSetVisible(GUIEditor_Image[1],false) end true) guiSetVisible(GUIEditor_Image[2],true) end false) Link to comment
3NAD Posted March 14, 2013 Share Posted March 14, 2013 لم يتم التجربة aImage = { } addEventHandler ( "onClientGUIClick", root, function ( ) if source == Button then if aImage [ img ] then local img = guiStaticImageLoadImage ( wnd, "1.png" ) aImage [ img ] = false else local img = guiStaticImageLoadImage ( wnd, "2.png" ) aImage [ img ] = true end end end ) Link to comment
CRoW,,# Posted March 14, 2013 Author Share Posted March 14, 2013 (edited) لم يتم التجربة aImage = { } addEventHandler ( "onClientGUIClick", root, function ( ) if source == Button then if aImage [ img ] then local img = guiStaticImageLoadImage ( wnd, "1.png" ) aImage [ img ] = false else local img = guiStaticImageLoadImage ( wnd, "2.png" ) aImage [ img ] = true end end end ) م اشتغل ذي النافذة function guiCreateWindow( x2, y2, width2, height2, titleBarText2, relative2 ) local mainBackground = guiCreateStaticImage ( x2, y2, width2, height2, "1.png", relative2 ) local mainBackgroundLabel = guiCreateLabel ( 0, 0, 250, 100, titleBarText2, false, mainBackground ) guiSetFont ( mainBackgroundLabel, newFont ) guiSetEnabled ( mainBackgroundLabel, false ) return mainBackground end GUIEditor_Button = {} wnd = guiCreateWindow(158,60,579,479,"Music script By !FP^B_o~L|B|/\/",false) guiSetVisible(wnd, false) guiSetAlpha(wnd,1) GUIEditor_Button[1] = guiCreateButton(16,75,105,35,"Music",false,wnd) GUIEditor_Button[2] = guiCreateButton(230,75,105,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[2],"default-bold-small") GUIEditor_Button[3] = guiCreateButton(457,75,94,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[3],"default-bold-small") GUIEditor_Button[4] = guiCreateButton(16,75,105,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[4],"default-bold-small") GUIEditor_Button[5] = guiCreateButton(16,171,105,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[5],"default-bold-small") GUIEditor_Button[6] = guiCreateButton(230,171,105,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[6],"default-bold-small") GUIEditor_Button[7] = guiCreateButton(459,171,94,35,"Music",false,wnd) GUIEditor_Button[8] = guiCreateButton(16,274,105,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[8],"default-bold-small") GUIEditor_Button[9] = guiCreateButton(230,274,105,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[9],"default-bold-small") GUIEditor_Button[10] = guiCreateButton(453,274,103,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[10],"default-bold-small") GUIEditor_Button[11] = guiCreateButton(12,388,105,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[11],"default-bold-small") GUIEditor_Button[12] = guiCreateButton(234,388,105,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[12],"default-bold-small") GUIEditor_Button[13] = guiCreateButton(451,388,105,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[13],"default-bold-small") GUIEditor_Button[15] = guiCreateButton(379,22,74,30,"تغير الخلفية",false,wnd) guiSetFont(GUIEditor_Button[15],"default-bold-small") isMove = false bindKey("F9", "down", function() if isMove then return end if guiGetVisible( wnd ) then guiSetVisible(wnd, false) showCursor(false) else guiSetPosition(wnd, -300, 54, false) guiSetVisible(wnd, true) showCursor(true) if isTimer(Time) then return end Time = setTimer(function() local x, y = guiGetPosition(wnd, false) guiSetPosition(wnd, x + 8, y, false) end, 50, 50) isWindowMove(true) setTimer(isWindowMove, 100, 1, false) end end ) function isWindowMove(bole) isMove = bole end Edited March 14, 2013 by Guest Link to comment
CRoW,,# Posted March 14, 2013 Author Share Posted March 14, 2013 وش الزر اللي تبية يغير؟ تغير الخلفية GUIEditor_Button[15] Link to comment
iPrestege Posted March 14, 2013 Share Posted March 14, 2013 تبية مثلا يضغط مرة ويضغط مرة ترجع او بس مرة وحدة يغيرها ولا يقدر يرجعها ذذ ؟؟ Link to comment
CRoW,,# Posted March 14, 2013 Author Share Posted March 14, 2013 تبية مثلا يضغط مرة ويضغط مرة ترجع او بس مرة وحدة يغيرها ولا يقدر يرجعها ذذ ؟؟ لا يقدر يرجعها يعني يضغط تتحول الصورة يضغط مرة ثانية ترجع الصورة الاولى Link to comment
iPrestege Posted March 14, 2013 Share Posted March 14, 2013 جرب الكود مختلف عن عناد تماما ذذ : function guiCreateWindow( x2, y2, width2, height2, titleBarText2, relative2 ) mainBackground = guiCreateStaticImage ( x2, y2, width2, height2, "1.png", relative2 ) local mainBackgroundLabel = guiCreateLabel ( 0, 0, 250, 100, titleBarText2, false, mainBackground ) guiSetEnabled ( mainBackgroundLabel, false ) return mainBackground end GUIEditor_Button = {} wnd = guiCreateWindow(158,60,579,479,"Music script By !FP^B_o~L|B|/\/",false) guiSetVisible(wnd, false) guiSetAlpha(wnd,1) GUIEditor_Button[1] = guiCreateButton(16,75,105,35,"Music",false,wnd) GUIEditor_Button[2] = guiCreateButton(230,75,105,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[2],"default-bold-small") GUIEditor_Button[3] = guiCreateButton(457,75,94,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[3],"default-bold-small") GUIEditor_Button[4] = guiCreateButton(16,75,105,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[4],"default-bold-small") GUIEditor_Button[5] = guiCreateButton(16,171,105,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[5],"default-bold-small") GUIEditor_Button[6] = guiCreateButton(230,171,105,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[6],"default-bold-small") GUIEditor_Button[7] = guiCreateButton(459,171,94,35,"Music",false,wnd) GUIEditor_Button[8] = guiCreateButton(16,274,105,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[8],"default-bold-small") GUIEditor_Button[9] = guiCreateButton(230,274,105,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[9],"default-bold-small") GUIEditor_Button[10] = guiCreateButton(453,274,103,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[10],"default-bold-small") GUIEditor_Button[11] = guiCreateButton(12,388,105,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[11],"default-bold-small") GUIEditor_Button[12] = guiCreateButton(234,388,105,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[12],"default-bold-small") GUIEditor_Button[13] = guiCreateButton(451,388,105,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[13],"default-bold-small") GUIEditor_Button[15] = guiCreateButton(379,22,74,30,"تغير الخلفية",false,wnd) guiSetFont(GUIEditor_Button[15],"default-bold-small") isMove = false bindKey("F9", "down", function() if isMove then return end if guiGetVisible( wnd ) then guiSetVisible(wnd, false) showCursor(false) else guiSetPosition(wnd, -300, 54, false) guiSetVisible(wnd, true) showCursor(true) if isTimer(Time) then return end Time = setTimer(function() local x, y = guiGetPosition(wnd, false) guiSetPosition(wnd, x + 8, y, false) end, 50, 50) isWindowMove(true) setTimer(isWindowMove, 100, 1, false) end end ) function isWindowMove(bole) isMove = bole end local load = false addEventHandler ( "onClientGUIClick", root, function ( ) if source == GUIEditor_Button[15] then guiStaticImageLoadImage(mainBackground,load and "1.png" or "2.png") load = not load end end ) اسم الصورهـ الثانية : 2.png Link to comment
CRoW,,# Posted March 14, 2013 Author Share Posted March 14, 2013 جرب الكود مختلف عن عناد تماما ذذ : function guiCreateWindow( x2, y2, width2, height2, titleBarText2, relative2 ) mainBackground = guiCreateStaticImage ( x2, y2, width2, height2, "1.png", relative2 ) local mainBackgroundLabel = guiCreateLabel ( 0, 0, 250, 100, titleBarText2, false, mainBackground ) guiSetEnabled ( mainBackgroundLabel, false ) return mainBackground end GUIEditor_Button = {} wnd = guiCreateWindow(158,60,579,479,"Music script By !FP^B_o~L|B|/\/",false) guiSetVisible(wnd, false) guiSetAlpha(wnd,1) GUIEditor_Button[1] = guiCreateButton(16,75,105,35,"Music",false,wnd) GUIEditor_Button[2] = guiCreateButton(230,75,105,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[2],"default-bold-small") GUIEditor_Button[3] = guiCreateButton(457,75,94,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[3],"default-bold-small") GUIEditor_Button[4] = guiCreateButton(16,75,105,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[4],"default-bold-small") GUIEditor_Button[5] = guiCreateButton(16,171,105,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[5],"default-bold-small") GUIEditor_Button[6] = guiCreateButton(230,171,105,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[6],"default-bold-small") GUIEditor_Button[7] = guiCreateButton(459,171,94,35,"Music",false,wnd) GUIEditor_Button[8] = guiCreateButton(16,274,105,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[8],"default-bold-small") GUIEditor_Button[9] = guiCreateButton(230,274,105,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[9],"default-bold-small") GUIEditor_Button[10] = guiCreateButton(453,274,103,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[10],"default-bold-small") GUIEditor_Button[11] = guiCreateButton(12,388,105,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[11],"default-bold-small") GUIEditor_Button[12] = guiCreateButton(234,388,105,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[12],"default-bold-small") GUIEditor_Button[13] = guiCreateButton(451,388,105,35,"Music",false,wnd) guiSetFont(GUIEditor_Button[13],"default-bold-small") GUIEditor_Button[15] = guiCreateButton(379,22,74,30,"تغير الخلفية",false,wnd) guiSetFont(GUIEditor_Button[15],"default-bold-small") isMove = false bindKey("F9", "down", function() if isMove then return end if guiGetVisible( wnd ) then guiSetVisible(wnd, false) showCursor(false) else guiSetPosition(wnd, -300, 54, false) guiSetVisible(wnd, true) showCursor(true) if isTimer(Time) then return end Time = setTimer(function() local x, y = guiGetPosition(wnd, false) guiSetPosition(wnd, x + 8, y, false) end, 50, 50) isWindowMove(true) setTimer(isWindowMove, 100, 1, false) end end ) function isWindowMove(bole) isMove = bole end local load = false addEventHandler ( "onClientGUIClick", root, function ( ) if source == GUIEditor_Button[15] then guiStaticImageLoadImage(mainBackground,load and "1.png" or "2.png") load = not load end end ) اسم الصورهـ الثانية : 2.png اشتغل مشكوور وربي ابداع Link to comment
iPrestege Posted March 14, 2013 Share Posted March 14, 2013 حياك الله | You're Welcome (; . Link to comment
CRoW,,# Posted March 14, 2013 Author Share Posted March 14, 2013 حياك الله | You're Welcome (; . ديما تفك لي ازمات Link to comment
iPrestege Posted March 14, 2013 Share Posted March 14, 2013 خخخـ (; طفش ذذ حياك الله اي شيء بالخدمة # Link to comment
CRoW,,# Posted March 14, 2013 Author Share Posted March 14, 2013 خخخـ (; طفش ذذ حياك الله اي شيء بالخدمة # خلك طفشان على طول نستفيد منكك ض1 Link to comment
iPrestege Posted March 14, 2013 Share Posted March 14, 2013 خلنا نهجد بسس لا يقولون ضيعوا مسار الموضوع ذذ Link to comment
CRoW,,# Posted March 14, 2013 Author Share Posted March 14, 2013 بوصل مشاركاتي 100 يغلقق تم الافادة Link to comment
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