Jump to content


Photo

LeftButton only hits on bottom half of sprite


  • Please log in to reply
10 replies to this topic

#1 yvesnadjarian

yvesnadjarian

    GMC Member

  • GMC Member
  • 171 posts
  • Version:GM:Studio

Posted 25 June 2012 - 04:19 AM

All right.. So Ive created a object with some actions on Left Mouse Button event.

The object mask is selected to be the same as sprite.
No matter what sprite I select to the object, the game only recognizes the mouse click on the half bottom part of the sprite..

I´ve checked the mask for the sprites I´ve tested and they are full image.



Any thoughs??? Thank you



EDIT:
This is getting even more weird.
If I add another instance on the room ABOVE the mouse seems to be able to click... something like this:

Imagine as buttons... two instances the upper instance continues to be half clickable
but the bottom is full clickable

Green = Clickable


------------------
------------------
------------------
------------------



------------------
------------------
------------------
------------------

Edited by yvesnadjarian, 25 June 2012 - 04:34 AM.

  • 0

#2 Swifty

Swifty

    Shadow

  • GMC Member
  • 376 posts
  • Version:GM:Studio

Posted 25 June 2012 - 04:33 AM

Are you using a Draw Event? If you are drawing the sprite at an x,y position you will still have to move its x,y to that place.

Copy the code over here from the object you're trying to click on? So we can better understand what's going on.

Swifty
  • 1

#3 yvesnadjarian

yvesnadjarian

    GMC Member

  • GMC Member
  • 171 posts
  • Version:GM:Studio

Posted 25 June 2012 - 04:36 AM

No... no drawing event... Its only a object to be clicked as a button.
There is no code.. just action to go to another room
(its a Play button)
  • 0

#4 Swifty

Swifty

    Shadow

  • GMC Member
  • 376 posts
  • Version:GM:Studio

Posted 25 June 2012 - 04:46 AM

No... no drawing event... Its only a object to be clicked as a button.
There is no code.. just action to go to another room
(its a Play button)

Which version of GM are you using? - are you using a Mouse - Left Release Event in your Play button to trigger the room change?

Swifty
  • 1

#5 yvesnadjarian

yvesnadjarian

    GMC Member

  • GMC Member
  • 171 posts
  • Version:GM:Studio

Posted 25 June 2012 - 04:59 AM

Itīs GM:Studio v1.0.253 (using stable channel)

I have tried all mouse functions: Release, Pressed and Button... all the same.
I had other rooms with buttons that worked fine, was testing and they are all like this now.. just the lower half is getting the click.

I must be a bug on update because those buttons were untouched
  • 0

#6 Swifty

Swifty

    Shadow

  • GMC Member
  • 376 posts
  • Version:GM:Studio

Posted 25 June 2012 - 05:08 AM

Does the same thing happen if you open up a new project and make a simple Play Button?

I'm using the same version as you; and I haven't got this problem. Try making a completely new room/object and let it play first with only your play button in there.

Swifty
  • 1

#7 yvesnadjarian

yvesnadjarian

    GMC Member

  • GMC Member
  • 171 posts
  • Version:GM:Studio

Posted 25 June 2012 - 05:19 AM

Hummm good..
A new project with the same sprite is working fine.


Still thinking what is causing this.. since my project its too big to start all again.


PS: Swifty thanks for trying to help

EDIT: tried to remove virtual keys.. still nothing

Edited by yvesnadjarian, 25 June 2012 - 11:54 AM.

  • 1

#8 Swifty

Swifty

    Shadow

  • GMC Member
  • 376 posts
  • Version:GM:Studio

Posted 25 June 2012 - 05:35 AM

Hummm good..
A new project with the same sprite is working fine.


Still thinking what is causing this.. since my project its too big to start all again.


PS: Swifty thanks for trying to help

EDIT: tried to remove virtual keys.. still nothing

No worries, I assume theres something conflicting with something else which is causing the problem to occur, which is why I suggested a new room with minimal objects so you can try and isolate the problem. If it runs fine with the minimal objects, slowly add the other ones you need in, until it starts happening and work out what the object is that's causing the conflict.

Swifty
  • 1

#9 yvesnadjarian

yvesnadjarian

    GMC Member

  • GMC Member
  • 171 posts
  • Version:GM:Studio

Posted 25 June 2012 - 11:54 AM

Iīve figured out.
My first room was smaller than the others, and the others get streched on the window size.
This is what was causing that.

I did this because im developing for android 480x800 but my PC resoltuion is 1366x768.
Backing the resolution to 480x800 fix the buttons.. but now I cant see the whole windows on my pc...
  • 0

#10 Swifty

Swifty

    Shadow

  • GMC Member
  • 376 posts
  • Version:GM:Studio

Posted 25 June 2012 - 12:55 PM

I'm not 100% sure what you mean by

"Backing the resolution to 480x800 fix the buttons.. but now I cant see the whole windows on my pc..."

but if you're developing for android at 480x800 you will want to have the Views tab settings at:

View in room:
W = 800
H = 480

Port on Screen:
W = 800
H = 480
And develop your game around that view size - as that's what will fit in the Android screen(if you Android screen res is 800x480 of course)

Swifty
  • 0

#11 yvesnadjarian

yvesnadjarian

    GMC Member

  • GMC Member
  • 171 posts
  • Version:GM:Studio

Posted 25 June 2012 - 03:26 PM

Oh.. thats because when testing the game on my Notebook, the game window is bigger than the resolution (800x height vs 763 height)

To fix this I have used in my first room a lower resolution, just to have the window smaller on my notebook.
But all other rooms were 800x480. So I guess GM kind of "get lost" with this.

This is really bad luck.. I have a good notebook with a decent videocard running games like DeadIsland... but this resolution f*** me
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users