HideImage???

Blitz3D Forums/Blitz3D Programming/HideImage???

Yue(Posted 2010) [#1]


Hello friends, I am working on the menu of my project and I encounter a problem, I need to clik on the button to half, the others disappear, are not visible as the menu gives way to the game options. So if there is not a command like hideentity, or something, any suggestions in this regard.

greetings.


Matty(Posted 2010) [#2]
Images are only drawn when you tell them to draw? Can't you just 'not draw' the image if you don't want it visible? I assume you refer to 2d commands? ie drawimage/drawblock


Yue(Posted 2010) [#3]
Hello I am grateful for your response, my English is bad and I help with a translator.

What I need is that, on having given clik in an image, other one hides for then visible again, something like showentity or hideentity, but in the images.

A greeting.


Who was John Galt?(Posted 2010) [#4]
No there is nothing.... you need to not draw them if you don't want them visible, as Matty said.


Yue(Posted 2010) [#5]
: ( Please example code??


wmaass(Posted 2010) [#6]
I think you just need some flag to know when to draw the image. Something like

if myFlag = True
    DrawImage myImage,x,y
endif


Also, if you have the funds I would recommend SpriteCandy.


Yue(Posted 2010) [#7]
Now then, what I need is that, on having given clik in an image other one, it hides...


dynaman(Posted 2010) [#8]
> Now then, what I need is that, on having given clik in an image other one, it hides...

I hate to say this, but if you need help with that I suggest a good basic programming book to start.


Yue(Posted 2010) [#9]
:(


wmaass(Posted 2010) [#10]
Assuming you have it worked out to know what buttons have been clicked it should be easy. If not, check out the "hole in one" 2D sample. It has some buttons in it with simple checking of buttons. There are probably other good examples in the samples folder.

Also check out this in the code arcs:

http://www.blitzbasic.com/codearcs/codearcs_bb/608.bb


xlsior(Posted 2010) [#11]
You'll have to change the code at the place that you do your drawimages:

   if imagevisible:int=True then
       drawimage(image1,10,10)
   else
       ' don't do anything
   end if


Then when you enable/disable the image, you can change the imagevisible variable to either 'true' or 'false' to change whether or not to draw it.


Yue(Posted 2010) [#12]
Graphics 800,600,32,False

Image = LoadImage("Botones.jpg")

While Not KeyDown (1)
	
	If KeyHit(200)
		DrawImage(Image,0,0)
		
	Else
		; Hide image??
		
	End If 
	
Wend  



Yue(Posted 2010) [#13]
hello, I've achieved what I'm doing is a 3d menu for my apliación and the only way is as follows.

Graphics3D 800,600,32,False

Image = LoadImage("Botones.jpg")
MaskImage image,255,255,255
Camara = CreateCamera()

Cube = CreateCube()

PositionEntity Cube,0,0,5


While Not KeyDown (1)
	RenderWorld 	
	If KeyDown(200)
		DrawImage(Image,0,0)
	Else
		
	End If 
	
	Flip 
Wend  


I greatly appreciate your help friends.


Yue(Posted 2010) [#14]
; Code FastImage cool :D.
	DrawImageEx (Salir,GraphicsWidth()-150,GraphicsHeight()-50,Estado)
	
	
	If TestImage(MouseX(),MouseY(),GraphicsWidth()-150,GraphicsHeight()-50,Salir) Then
		Estado = 1
	Else 
		Estado = 0
	End If 
	EndDraw