Last change
on this file was
49,
checked in by Sam Hocevar, 15 years ago
|
- Imported original public domain release, for future reference.
|
File size:
1.1 KB
|
Line | |
---|
1 | #ifndef __MOUSE_HPP_ |
---|
2 | #define __MOUSE_HPP_ |
---|
3 | #include "image.hpp" |
---|
4 | #include "sprite.hpp" |
---|
5 | |
---|
6 | class JCMouse |
---|
7 | { |
---|
8 | int here,but; |
---|
9 | sprite *sp; |
---|
10 | int lx,ly,lbut,mx,my; |
---|
11 | int cx,cy; // center of mouse cursor |
---|
12 | public : |
---|
13 | JCMouse(image *Screen, palette *pal); |
---|
14 | void set_shape(image *im, int centerx=0, int centery=0); |
---|
15 | void update(int newx=-1, int newy=-1, int new_but=-1); |
---|
16 | void set_shape(image *im) { if (here) sp->change_visual(im); } |
---|
17 | int x() { if (here) return mx; else return 0; } |
---|
18 | int y() { if (here) return my; else return 0; } |
---|
19 | int drawx() { return mx-cx; } |
---|
20 | int drawy() { return my-cy; } |
---|
21 | int lastx() { if (here) return lx; else return 0; } |
---|
22 | int lasty() { if (here) return ly; else return 0; } |
---|
23 | int last_button() { if (here) return lbut; else return 0; } |
---|
24 | int button() { return but; } |
---|
25 | int exsist() { return here; } |
---|
26 | int center_x() { return cx; } |
---|
27 | int center_y() { return cy; } |
---|
28 | |
---|
29 | sprite *mouse_sprite() { return sp; } |
---|
30 | void set_position(int new_mx, int new_my); |
---|
31 | ~JCMouse(); |
---|
32 | |
---|
33 | #ifdef __MAC__ |
---|
34 | int set_button(int b) { return (but = b); } |
---|
35 | #endif |
---|
36 | } ; |
---|
37 | |
---|
38 | #endif |
---|
39 | |
---|
Note: See
TracBrowser
for help on using the repository browser.