Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: Using a sprite in inventory  (Read 4025 times)

0 Members and 1 Guest are viewing this topic.

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Using a sprite in inventory
« on: June 28, 2009, 06:32:52 AM »

I wanted to use a sprite of a door knob taken into inventory rather than just a png pic because the sprite lets me set the active point precisely on the handle so the handle connects nicely with the spot where it has to go.

BUT

In inventory the sprite is pushed way up so only the lower part is showing.  The sprite and the png it contains are the same size so I don't know why the sprite is pushed up so far in inventory.  Any thoughts?  I don't have to do it this way but it's more realistic. If I'm not clear I could put a screenshot.
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Azrael

  • Regular poster
  • ***
  • Karma: 9
  • Offline Offline
  • Gender: Male
  • Posts: 155
    • View Profile
    • Mad Orange
Re: Using a sprite in inventory
« Reply #1 on: June 28, 2009, 08:14:13 AM »

I never used a sprite for the inventory but could be the sprite's active point used as top left start point for the item cell?
It's the handle to the top left cell's point?

If so the only way to see the object correctly should be modify the entire inventory (and items) moving it down and making it bigger so the item should be visible entirely.
But i think it should be better, faster and easier to use a simple image instead of the sprite ;)

Otherwise another way could be place the "item" not as a item but as window element. A static control for the image and a button for the active point. Obviously this will cause many other problems, i don't know if it's a valid alternative  ;D
Logged

mylesblasonato

  • Developer
  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 265
  • "Give up is to fail as sacrifice is to succeed"
    • View Profile
    • Royal Wins
Re: Using a sprite in inventory
« Reply #2 on: June 28, 2009, 01:10:06 PM »

Hi there,
In your item definition just use the sprite instead of the png in the filename.
E.G - instead of the following
Code: [Select]
IMAGE = "items\book.bmp"

have the following
Code: [Select]
IMAGE = "items\book.sprite"
Hope that makes sense, if not then please reply. Also in the sprite editor go into properties and tick pixel precise if you want precise collision between items, this makes it easier for combining items and stuff.

Cheers  ::beer
Myles Blasonato.
Logged
Lead Game Designer, Royal Wins.
@mylesblasonato
@royalwins
http://au.linkedin.com/pub/myles-blasonato/26/600/a38

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: Using a sprite in inventory
« Reply #3 on: June 30, 2009, 04:57:17 AM »

Thanks for answering Azrael and Myles.

Azrael, it may be easier just to use the png. On the other hand, I could move the image down in the png and make it bigger--

Myles,

I did put

IMAGE = "items\x.sprite"

I will try that pixel precise.  I've been turning it off for some reason. 

Thanks very much.

Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Using a sprite in inventory
« Reply #4 on: July 04, 2009, 08:01:55 AM »

You should use a different sprite for the inventory representation and a different sprite for the mouse pointer. And disabling pixel perfect mouse detection for inventory items is indeed a good idea. I hate games with tiny inventory items that are hard to pick with mouse.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: Using a sprite in inventory
« Reply #5 on: July 05, 2009, 08:20:21 AM »

Thanks, Mnemonic. I have worked very, very, very hard to make it easy to pick objects with the mouse.  Smooth gameplay, imho, is very important.

But is there a way to disable pixel perfect mouse detection for inventory items that I may have missed?
« Last Edit: July 05, 2009, 08:53:45 AM by Catacomber »
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  
 

Page created in 0.021 seconds with 24 queries.