var MyGameForm:TclGameForm; MyMQTT : TclMQTT; BtnBasla,BtnDur: TclButton; SndFire:Integer; mainPnl,imgMainPnl,imgPnl,imgIciPnl,descriptionPnl : TclProPanel; iconImg,iconGiftImg,iconIndicatorBarImg,captionImg : TClProImage; CekilisTimer:TClTimer; dondur : Integer; InformationLbl : TClProLabel; CekilisBtn : TClProButton; QMemList:TclJSonQuery; winUserGUID,executiveUserGUID : String; void MyMQTTStatusChanged; { if (Not MyMQTT.Connected ) { try MyMQTT.Connect; except ShowMessage('İnternet bağlantınızı kontrol ediniz... ' + 'Exception Class: ' + LastExceptionClassName + ' Exception Message: ' + LastExceptionMessage); } } }
void MyMQTTPublishReceived; { if (Not Clomosy.PlatformIsMobile) { if (CekilisTimer.Enabled && (MyMQTT.ReceivedMessage == 'durdur')) { if (Clomosy.AppUserProfile == 1) { CekilisBtn.Visible = False; } if (not Clomosy.PlatformIsMobile) { CekilisBtn.Enabled = True; } CekilisTimer.Enabled = False; }
} Else { MyGameForm.AddNewEvent(CekilisBtn,tbeOnClick,'BtnCekilisYapClick'); } }
void ProcOnCekilisTimer; { // InformationLbl.Caption = QMemList.FieldByName('Member_Name').AsString; //Clomosy.ProcessMessages; //QMemList.Next; if (QMemList.EOF) QMemList.First; if (dondur >= 360) { dondur = 50; } iconImg.RotationAngle = dondur; dondur = dondur - 20; }
void BtnCekilisYapClick; { MyMQTT.Send('durdur'); }
void randomNumber var number:Float; { number = Random() * 100; } void CekilisTimerStop; { CekilisTimer.Enabled = False; MyMQTT.Send('durdur'); }
void BtnIsimKaristirClick; { if (Not CekilisTimer.Enabled) { QMemList = Clomosy.DBCloudQueryWith(ftMembers,'','ISNULL(PMembers.Rec_Deleted,0)=0 AND PMember_Profile <> 1 ORDER BY NEWID()');//her seferinde karışık member listesi al } //CekilisTimer.Enabled = Not CekilisTimer.Enabled; CekilisTimer.Enabled = True; InformationLbl.Caption = ''; MyMQTT.Send('basladi'); MyGameForm.RunTimer("CekilisTimerStop", randomTime * 1000); // Rastgele süre sonunda timer'ı durdur }
{
dondur = -50; MyGameForm = TclGameForm.Create(Self); MyGameForm.SetFormBGImage(' https://i.hizliresim.com/q9396ef.png" rel="nofollow - https://i.hizliresim.com/q9396ef.png '); // arka plan MyGameForm.LytTopBar.Visible =True; MyMQTT = MyGameForm.AddNewMQTTConnection(MyGameForm,'MyMQTT'); MyGameForm.AddNewEvent(MyMQTT,tbeOnMQTTStatusChanged,'MyMQTTStatusChanged'); MyGameForm.AddNewEvent(MyMQTT,tbeOnMQTTPublishReceived,'MyMQTTPublishReceived'); MyMQTT.Channel = 'cekilis';//project guid + channel MyMQTT.Connect; mainPnl=MyGameForm.AddNewProPanel(MyGameForm,'mainPnl'); clComponent.SetupComponent(mainPnl,'{ "Align" : "Center", "MarginBottom" : 80 }');
imgMainPnl=MyGameForm.AddNewProPanel(mainPnl,'imgMainPnl'); clComponent.SetupComponent(imgMainPnl,'{"Align" : "Top","MarginTop":30,"MarginLeft":'+IntToStr(mainPnl.Width/9)+',"MarginRight":'+IntToStr(mainPnl.Width/9)+', "Height":'+IntToStr(mainPnl.Height/3)+'}'); imgPnl=MyGameForm.AddNewProPanel(imgMainPnl,'imgPnl'); clComponent.SetupComponent(imgPnl,'{"Align" : "Center","Width":'+IntToStr(imgMainPnl.Height)+', "Height":'+IntToStr(imgMainPnl.Height)+'}'); iconImg = MyGameForm.AddNewProImage(imgPnl,'iconImg'); clComponent.SetupComponent(iconImg,'{"Align" : "Center", "Width" : 200, "Height" : 200, "ImgUrl":" https://i.hizliresim.com/pc71kjt.png" rel="nofollow - https://i.hizliresim.com/pc71kjt.png" , "ImgFit":"yes"}'); imgIciPnl=MyGameForm.AddNewProPanel(imgPnl,'imgIciPnl'); clComponent.SetupComponent(imgIciPnl,'{"Align" : "Center","Height":'+IntToStr(imgPnl.Height/3)+',"Width":'+IntToStr(imgPnl.Width)+'}'); InformationLbl = MyGameForm.AddNewProLabel(mainPnl,'InformationLbl',''); clComponent.SetupComponent(InformationLbl,'{"Align" : "Top","MarginTop":10,"Height":'+IntToStr(mainPnl.Height/9)+',"MarginLeft":'+IntToStr(mainPnl.Width/9)+',"MarginRight":'+IntToStr(mainPnl.Width/9)+', "TextColor":"#f50505","TextSize":16,"TextVerticalAlign":"center", "TextHorizontalAlign":"center","TextBold":"yes"}'); CekilisBtn = MyGameForm.AddNewProButton(mainPnl,'CekilisBtn',''); clComponent.SetupComponent(CekilisBtn, '{ "Align" : "Center", "MarginTop":500, "TextColor":"#2705eb", "TextBold":"yes", "RoundHeight":3, "RoundWidth":3, "BackgroundColor":"#e3c76b", "Height":'+IntToStr(mainPnl.Height/2)+',"MarginLeft":'+IntToStr(mainPnl.Width/2)+',"MarginRight":'+IntToStr(mainPnl.Width/2)+'}'); CekilisBtn.Visible = True; QMemList = Clomosy.DBCloudQueryWith(ftMembers,'','ISNULL(PMembers.Rec_Deleted,0)=0 ORDER BY NEWID()'); if (not Clomosy.PlatformIsMobile) { winUserGUID = Clomosy.AppUserGUID; QMemList.Filter = 'Member_GUID <> '+QuotedStr(winUserGUID); QMemList.Filtered = True; MyGameForm.AddNewEvent(CekilisBtn,tbeOnClick,'BtnIsimKaristirClick'); CekilisTimer= MyGameForm.AddNewTimer(MyGameForm,'CekilisTimer',1000); CekilisTimer.Interval = 100; CekilisTimer.Enabled = False; MyGameForm.AddNewEvent(CekilisTimer,tbeOnTimer,'ProcOnCekilisTimer'); } else { if (Clomosy.AppUserProfile == 1) { InformationLbl.Text = 'Information Label'; executiveUserGUID = Clomosy.AppUserGUID; QMemList.Filter = 'Member_GUID <> '+QuotedStr(executiveUserGUID); QMemList.Filtered = True; } else { InformationLbl.Text = 'Information Label Else'; } } if(Clomosy.PlatformIsMobile) MyGameForm.Run; else MyGameForm.RunModal; }
Merhabalar Butona Basıldığı zaman ekrandaki resmim dönmeye başlıyor , butona tekrar tıkladığım zaman dönmeyi bırakıyor. ben bu işlemi random bir değer atayarak , o atanan random değer süresi boyunca resmin dönüp süre bitince durmasını istiyorum ancak yazdığım kodda hata alıyorum
|