[Qt-interest] Howto Do `hit Test' with QGraphicsItems ?

Mihail Naydenov mlists at ymail.com
Wed May 5 13:06:02 CEST 2010


If you read the docs you will find you way around.

Hints:
QGraphicsItem::contains() 
QGraphicsItem::collidesWithItem()

MihailNaydenov


----- Original Message ----
> From: Aaron Lewis <aaron.lewis1989 at gmail.com>
> To: "qt-interest at trolltech.com" <qt-interest at trolltech.com>
> Sent: Wed, May 5, 2010 1:47:53 PM
> Subject: [Qt-interest] Howto Do `hit Test' with QGraphicsItems ?
> 
> -----BEGIN PGP SIGNED MESSAGE-----
Hash: 
> SHA1

Hi,
    I'm deploying a small game , which i need 
> to set up some `edges'. I've
learned the term hitTest from Flash , kinda of 
> collision detections.

    e.g I have a wall around a map , 
> and player should not get out of the
yard , any move towards a wall is 
> disallowed.

    So far what i tried is to take advantage 
> of coordinate system.
    Rely on each items' pos() function 
> with their image size , not so good
anyway.

    Does 
> anyone has any good ideas ?
    
    
> Appreciate any of your help ;-)


- -- 
Best Regards,
Aaron Lewis 
> - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 
> 32A0
irc: A4r0n on freenode
-----BEGIN PGP SIGNATURE-----
Version: 
> GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Mozilla - 
> http://enigmail.mozdev.org/

iEYEARECAAYFAkvhTNkACgkQvf41sEptMqC+pwCeNy5CYwu2ECFont6VXIqvCgzH
8EoAoKYOqrgaJ4yHKW+UFDuJIm2krP+l
=FOly
-----END 
> PGP 
> SIGNATURE-----
_______________________________________________
Qt-interest 
> mailing list

> href="mailto:Qt-interest at trolltech.com">Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest


      



More information about the Qt-interest-old mailing list