The following code changes the cursor depending on which side of the main character the mouse is pointed to. It works unless I have a wide room; one that scrolls. Is there any way I could change this code to make it work. I believe it is happening because either the mouse.x or character.x is using the base 300x200 reference and the other is actually using the dimensions of the background.
if (mouse.x < character.x) {
ChangeCursorGraphic (0, 78);
}
else { // right-click, so cycle cursor
ChangeCursorGraphic (0, 2054);
}
yep, you need to add a viewportX offset to mouse.x position:
if (GetViewportX() + mouse.x < character.x) {
ChangeCursorGraphic (0, 78);
}
else { // right-click, so cycle cursor
ChangeCursorGraphic (0, 2054);
}
~cheers
Thanx Scorpiorus!