Posted: 28th Jan 2022 3:55
This worked before no problem

Now, if I add GetPointerPressed on my phone it does nothing. on my pc it works fine.
Posted: 28th Jan 2022 7:10
It works perfectly.
If you show me your code, I can point out what you are doing wrong.
Posted: 28th Jan 2022 8:49
Ok This is just a basic regular easy menu set up

I do not see any problems, it is odd because this worked on my phone last week.

Note: When I take out GetPointerPressed() it works, but I need it to only load when the pointer is pressed.

+ Code Snippet
function  Menu()

DeleteAllText() 
DeleteAllImages() 
DeleteAllSprites() 
DeleteSlider("Music")
DeleteSlider("Sound Effects")


for allsounds=0 to 500000
if GetSoundExists(allsounds)=1 then DeleteSound(allsounds)	
next allsounds
	
for allmusic=0 to 500000
if GetMusicExistsOGG(allmusic)=1 then DeleteMusicOGG(allmusic)	
next allmusic
Lost_Game=0

#include "Slider.agc"

	
MenuBackGroundImage=LoadImage("zombie5 icon_no_bg.png")	
MenuBackGround=CreateSprite(MenuBackGroundImage)	
SetSpriteScale(MenuBackGround,0.1,0.1)
SetSpritePositionByOffset(MenuBackGround,50,50)

OptionsBackGroundImage=LoadImage("Skills.png")
OptionsBackGround=createsprite(OptionsBackGroundImage)
SetSpriteScale(OptionsBackGround,0.05,0.05)
SetSpritePositionByOffset(OptionsBackGround,50,50)

PlayButton=loadimage("PlayGame.png")
SettingsButton=loadimage("Settings.png")
closebutton=loadimage("close.png")

PlayGame=Createsprite ( PlayButton )
SetSpriteScale ( PlayGame, 0.06,0.06)
SetSpritePositionByOffset ( PlayGame,10,70)
SetspriteDepth(PlayGame,1)
SetspriteVisible(PlayGame,1)

GameOptions=Createsprite ( SettingsButton )
SetSpriteScale ( GameOptions, 0.06,0.06)
SetSpritePositionByOffset ( GameOptions,10,80)
SetspriteDepth(GameOptions,1)
SetspriteVisible(GameOptions,1)

CloseOptions=Createsprite ( closebutton )
SetSpriteScale ( CloseOptions, 0.01,0.01)
SetSpritePositionByOffset ( CloseOptions,68,84)
SetspriteDepth(CloseOptions,1)
SetspriteVisible(CloseOptions,0)

Menu_Tital_Egypt_Image=LoadImage("ejypt.png")
Menu_Tital_Versus_Image=LoadImage("vs.png")
Menu_Tital_Zombies_Image=LoadImage("zombies.png")

Menu_Egypt=createsprite(Menu_Tital_Egypt_Image)
SetSpriteScale ( Menu_Egypt, 0.1,0.1)
SetSpritePositionByOffset ( Menu_Egypt,50,-60)
SetspriteDepth(Menu_Egypt,1)
SetspriteVisible(Menu_Egypt,1)
SetSpritePhysicsOn ( Menu_Egypt, 2 )

Menu_Versus=createsprite(Menu_Tital_Versus_Image)
SetSpriteScale ( Menu_Versus, 0.1,0.1)
SetSpritePositionByOffset ( Menu_Versus,49,-50)
SetspriteDepth(Menu_Versus,1)
SetspriteVisible(Menu_Versus,1)
SetSpritePhysicsOn ( Menu_Versus, 2 )

Menu_Zombies=createsprite(Menu_Tital_Zombies_Image)
SetSpriteScale ( Menu_Zombies, 0.1,0.1)
SetSpritePositionByOffset ( Menu_Zombies,49,-40)
SetspriteDepth(Menu_Zombies,1)
SetspriteVisible(Menu_Zombies,1)
SetSpritePhysicsOn ( Menu_Zombies, 2 )

Bar=createsprite(0)
SetSpriteScale ( Bar, 100,0.1)
SetSpritePositionByOffset ( Bar,50,51)
SetSpritePhysicsOn ( Bar, 1 )
SetSpriteVisible(Bar,0)

TouchSound=loadsound("ActivateBeep.wav")

// must be called before any other slider functions
InitSliders()
 
// create some sliders
// name, min, max, x position, y position
CreateSlider("Music", 0, 100, 40, 43)
SetSliderValue("Music", 4)

CreateSlider("Sound Effects", 0, 100, 40, 63)
SetSliderValue("Sound Effects", 4)

LogoImage=LoadImage("logo_red.png")
Logo=CreateSprite(LogoImage)
SetSpriteScale(Logo,0.07,0.07)
SetSpritePositionByOffset(Logo,85,80)

Menu_Music=LoadMusicOGG("Farzad Farhangi - Mastika.ogg")


CreateEditBox( 1 )
SetEditBoxBorderSize( 1, 0.5 )
SetEditBoxBorderColor( 1, 0, 0, 0, 255 )
SetEditBoxMaxChars( 1,8 )
SetEditBoxPosition( 1, 2, 30 )
SetEditBoxSize( 1, 13, 5)
SetEditBoxTextSize( 1, 10 )
SetEditBoxCursorWidth( 1, 0.3 )
SetEditBoxCursorPosition( 1,5)
SetEditBoxScissor( 1, 0, 0, 0, 0 )
FixEditBoxToScreen ( 1, 1 )
SetEditBoxPosition( 1, 5, 30 )


    Name_text=CreateText ( "Enter Name" )
	SetTextPosition ( Name_text,5.5, 30)
	SetTextSize ( Name_text, 5 )
	FixTextToScreen ( Name_text, 1 )
    SetTextColor(Name_text,0,0,0,255)
    
x# = GetPointerX ( )
y# = GetPointerY ( )
Pressed=GetPointerPressed()
Released=GetPointerReleased()

    
    Wrote_Name=GetEditBoxCursorPosition( 1 )
    Name$= GetEditBoxText( 1 )
     SetEditBoxText( 1, Name$  )  
     
 if GettextHitTest( Name_text, x#, y# ) =1   and pressed=1   then edit=1
 
Print_warning_text_1=CreateText ( "No file for given name" )
SetTextPosition ( Print_warning_text_1,2,30)
SetTextSize ( Print_warning_text_1, 8 )
FixTextToScreen ( Print_warning_text_1, 1 )
SetTextColorAlpha ( Print_warning_text_1, 255 )
SetTextDepth(Print_warning_text_1,1)
SetTextVisible(Print_warning_text_1,0)

Print_warning_text_2=CreateText ( "Enter Your Name To Play" )
SetTextPosition ( Print_warning_text_2,30,60)
SetTextSize ( Print_warning_text_2, 8 )
FixTextToScreen ( Print_warning_text_2, 1 )
SetTextColor ( Print_warning_text_2,190,255,0,255 )
SetTextDepth(Print_warning_text_2,1)
SetTextVisible(Print_warning_text_2,0)

Player_save_text=CreateText ( "Saved Game=" )
SetTextPosition ( Player_save_text,23,20)
SetTextSize ( Player_save_text, 5 )
FixTextToScreen ( Player_save_text, 1 )
SetTextColorAlpha ( Player_save_text, 255 )
SetTextDepth(Player_save_text,1)
SetTextVisible(Player_save_text,0)

Player_Delete_text=CreateText ( "Press to delete saved game" )
SetTextPosition ( Player_Delete_text,10,25)
SetTextSize ( Player_Delete_text, 5 )
FixTextToScreen ( Player_Delete_text, 1 )
SetTextColorAlpha ( Player_Delete_text, 255 )
SetTextDepth(Player_Delete_text,1)
SetTextVisible(Player_Delete_text,0)

path as string
path = GetWritePath()+"media"
folderID = OpenRawFolder( path )
folderCount = GetRawFolderNumFolders(folderID)
fileCount = GetRawFolderNumFiles(folderID)

video=LoadVideo( "2.mp4" )
videoimage=1000
PlayVideoToImage( videoimage )
videosprite = createSprite(videoimage)
vidmaskshader = LoadspriteShader("alphavid.ps")
SetShaderConstantByName(vidmaskshader , "_cutoff_level",0.56,0.0,0.0,0) 
SetSpriteShader(videosprite,vidmaskshader)
SetSpriteSize(videosprite,42,42)
SetSpritePosition(videosprite,25,60)
SetSpriteDepth(videosprite,0)

do

SetTextVisible(Demo,0)

 if getvideoplaying()=0 or GetPointerPressed()=1
  SetSpriteVisible(videosprite,0)
  DeleteSprite(videosprite)
  deletevideo()
  DeleteShader(vidmaskshader)
 endif


spritey= GetSpriteY( Menu_Egypt )
spritex= GetSpriteX( Menu_Egypt )



SetPhysicsGravity ( 0, 60.0)


if GetMusicPlayingOGG(Menu_Music)=0 then PlayMusicOGG(Menu_Music,1)	
 SetMusicSystemVolumeOGG( GetSliderValue("Music") ) 


 ///////////////////////////////////////////////////////////////////////////////////////////

//                           Regular Menu 

///////////////////////////////////////////////////////////////////////////////////////////	
HitPlay=GetspriteHitTest (PlayGame, GetPointerX ( ), GetPointerY ( ) )

Hitlogo=GetSpriteHitTest (Logo, GetPointerX ( ), GetPointerY ( ) )

If Hitlogo=1 

OpenBrowser( "https://www.appgamekit.com/")	
MinimizeApp()
endif

SetEditBoxActive(1,1)

if HitPlay=1 and Options=0
SetspriteColor(PlayGame,200,200,200,255)
if clickOnce2=0
ClickSound=PlaySound(TouchSound,GetSliderValue("Sound Effects"),0)
clickOnce2=1
endif
else
SetspriteColor(PlayGame,255,255,255,255)
clickOnce2=0
endif
     
    Wrote_Name=GetEditBoxCursorPosition( 1 )
    Name$= GetEditBoxText( 1 )

if Wrote_Name=0 then SetTextVisible(Name_text,1)
if Wrote_Name>0 then SetTextVisible(Name_text,0)

     
if GetPointerPressed()=1  and  HitPlay=1 and Wrote_Name<4 and Options=0
Setwarning=1
endif

if GetPointerPressed()=1  and HitPlay=0 and Wrote_Name<4
Setwarning=0
endif   
 
 if Setwarning=0
SetTextVisible(Print_warning_text_2,0)	 
endif  
     
 if Setwarning=1
SetTextVisible(Print_warning_text_2,1)	 
endif    
     
if GetPointerPressed()=1  and HitPlay=1 and Wrote_Name>4 and Options=0
for x=0 to 1
SetSpriteVisible(_sliderResource.sliderList[x].sprBar, 0)	
SetSpriteVisible(_sliderResource.sliderList[x].sprHandle, 0)
SetTextVisible(_sliderResource.sliderList[x].txtLabel ,0)
SetTextVisible(_sliderResource.sliderList[x].txtValue  ,0)
SetSpriteVisible(OptionsBackGround,0)
next x
DeleteSound(TouchSound)	
DeleteSprite(MenuBackGround)
DeleteImage(MenuBackGroundImage)
Deletesprite(PlayGame)
DeleteImage(PlayButton)
DeleteText(Print_warning_text_2)
DeleteSprite(Logo)
DeleteImage(LogoImage)
StopMusicOGG(Menu_Music)	
DeleteMusic(Menu_Music)
deletetext(Name_text)
Deletesprite(Menu_Egypt)
Deletesprite(Menu_Versus)
Deletesprite(Menu_Zombies)
Deletesprite(Bar)
SetEditBoxText( 1, Name$  )
DeleteEditBox(1) 
SetSpriteVisible(videosprite,0)
deletevideo()
DeleteShader(vidmaskshader) 
Save_last_Player()
Save_Game()
 
gosub JumpToGame

endif    
     
     
 ///////////////////////////////////////////////////////////////////////////////////////////

//                                  Options Menu 

///////////////////////////////////////////////////////////////////////////////////////////	     
HitOptions=GetspriteHitTest (GameOptions, GetPointerX ( ), GetPointerY ( ) )
HitOptionsimg=GetspriteHitTest (CloseOptions, GetPointerX ( ), GetPointerY ( ) )
     
if HitOptions=1 and Options=0
SetspriteColor(GameOptions,200,200,200,255)
if clickOnce=0
ClickSound=PlaySound(TouchSound,GetSliderValue("Sound Effects"),0)
clickOnce=1
endif
else
SetspriteColor(GameOptions,255,255,255,255)
clickOnce=0
endif    
 
if GetPointerPressed()=1 and HitOptions=1 then inc Options,1

if Options>1 then options=0 
 
 if Options=1 then HandleSliders() 
 
      
 if Options=0
	
for x=0 to 1
SetSpriteVisible(_sliderResource.sliderList[x].sprBar, 0)	
SetSpriteVisible(_sliderResource.sliderList[x].sprHandle, 0)
SetTextVisible(_sliderResource.sliderList[x].txtLabel ,0)
SetTextVisible(_sliderResource.sliderList[x].txtValue  ,0)
SetSpriteVisible(OptionsBackGround,0)
SetspriteVisible(closebutton,0)
SetspriteVisible(Menu_Egypt,1)
SetspriteVisible(Menu_Versus,1)
SetspriteVisible(Menu_Zombies,1)

next x
endif

if Options=1
	
SetEditBoxActive(1,0)	
	
for x=0 to 1
SetSpriteVisible(_sliderResource.sliderList[x].sprBar, 1)	
SetSpriteVisible(_sliderResource.sliderList[x].sprHandle, 1)
SetTextVisible(_sliderResource.sliderList[x].txtLabel ,1)
SetTextVisible(_sliderResource.sliderList[x].txtValue  ,1)
SetSpriteVisible(OptionsBackGround,1)
SetspriteVisible(closebutton,1)
next x
SetspriteVisible(Menu_Egypt,0)
SetspriteVisible(Menu_Versus,0)
SetspriteVisible(Menu_Zombies,0)

 
endif
 
 if HitOptionsimg=1 and GetPointerPressed()=1 then Options=0
   
     
    Sync()
loop	
	

endfunction
Posted: 28th Jan 2022 12:58
That's quite a lot of code to debug when it can't be run without the media, so help me out:
Which of the seven instances of GetPointerPressed() do you think isn't working?
What are you expecting to happen?
What does happen?
What happens when you remove GetPointerPressed() ? and which one are you removing?
Posted: 28th Jan 2022 14:47
HI

Ok, So when I Press on play game on my phone it does not do anything. That would be the this code here.

+ Code Snippet
if GetPointerPressed()=1  and HitPlay=1 and Wrote_Name>4 and Options=0
for x=0 to 1
SetSpriteVisible(_sliderResource.sliderList[x].sprBar, 0)   
SetSpriteVisible(_sliderResource.sliderList[x].sprHandle, 0)
SetTextVisible(_sliderResource.sliderList[x].txtLabel ,0)
SetTextVisible(_sliderResource.sliderList[x].txtValue  ,0)
SetSpriteVisible(OptionsBackGround,0)
next x
DeleteSound(TouchSound) 
DeleteSprite(MenuBackGround)
DeleteImage(MenuBackGroundImage)
Deletesprite(PlayGame)
DeleteImage(PlayButton)
DeleteText(Print_warning_text_2)
DeleteSprite(Logo)
DeleteImage(LogoImage)
StopMusicOGG(Menu_Music)    
DeleteMusic(Menu_Music)
deletetext(Name_text)
Deletesprite(Menu_Egypt)
Deletesprite(Menu_Versus)
Deletesprite(Menu_Zombies)
Deletesprite(Bar)
SetEditBoxText( 1, Name$  )
DeleteEditBox(1) 
SetSpriteVisible(videosprite,0)
deletevideo()
DeleteShader(vidmaskshader) 
Save_last_Player()
Save_Game()
  
gosub JumpToGame
 
endif  


When I just say this

if HitPlay=1 and Wrote_Name>4 and Options=0

My game loads just fine..

So in conclusion GetPointerPressed() has stopped working on my phone, or it could be app game kit player


I noticed it has been having problems , not starting, crashing and other stuff. I have to delete it then reinstall it all the time.
Posted: 28th Jan 2022 16:43
As I said, it's very difficult to test it when I can't compile it but my first thought would be that there may be an issue with the multiple calls for the pointer condition/position.
You are doing this at the start:
+ Code Snippet
x# = GetPointerX ( )
y# = GetPointerY ( )
Pressed=GetPointerPressed()
Released=GetPointerReleased()

So, I would suggest using those variables in place of all the other calls to those commands later in the code and see if that helps.
But I seriously doubt this is an error with AppGameKit since of all the 1000's of AppGameKit users, you are the only one with this issue.
Posted: 28th Jan 2022 20:07
You only sync when HitOptionsimg=1. It's a guess but i would remove that condition (just as a test and see if it works) because getpointerpressed() will only register if you sync().
I think it may not be working because of differences in resolution between your device and your PC
Posted: 29th Jan 2022 1:12
But I seriously doubt this is an error with AppGameKit since of all the 1000's of AppGameKit users, you are the only one with this issue.


Well I do not know, On my pc My guns in my game never delete, not once. They all are created and fine, but on your pc and another they delete for some strange reason. My point is It might not be app game kit at all.

It might be the device or like I stated app game player its self.

I think it may not be working because of differences in resolution between your device and your PC


I considered this myself but then, The img changes color when my cursor touches the image and also the sound plays.

If I find reason I will post it just to let you gentleman know.