J3ff0's Recent Forum Activity

  • MouseKeyboard.AbsMouseX-Window.X will give you the X position of the mouse relative to the window.

    Great, thanks! I realized after posting that it would probably be some algebraic logic to do it, but I was having trouble getting my head around it.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • UPDATE:

    Playing around with the debugging frame, it looks like I've figured out the source of the problem: MouseX and MouseY are relative to the mouse position in the LAYOUT, not the mouse position in the WINDOW. Thusly, whenever the screen is scrolling to the right, MouseX is continuously increasing while the mouse is stationary.

    So, my question has changed:

    Does anyone know of a way to retrieve the mouse pointer location in terms of the window, instead of in terms of the layout?

  • I'm working on a miniature sidescrolling project. I want the application window to be drag-moveable while it scrolls, but I'm getting funny behavior out of this.

    My current implementation for scrolling is just like the 'ghost shooter' tutorial: I have a 88x31 game window with a 300x31 layout, and it constantly keeps a horizontally-moving object in the center.

    My current implementation for dragging is that clicking the window sets a value to 1 and records the current mouse location, and as long as the value is set to 1, the window will be moved to its current location plus the difference between the current mouse location and the initial mouse location. When the button is released, the value is set to 0.

    The scrolling works on its own, and the dragging works on its own. But when I have the mouse held down while the game window scrolls, the window inexplicably moves to the right along with the character, while the background of the layout stays almost stationary.

    I'm surely doing something wrong, but I can't figure it out. Can anyone help with this problem?

    Screenshot of events:

    <img src="http://i.imgur.com/nxse3.png">

    Source:

    Tiny_Crawl_World.cap (41 KB)

  • Edit: Aaaaand we're good. In case any other newbies out there are having my problem:

    Under 'Runtime Properties' in Project Properties, setting Sampling to 'Point' instead of 'Linear' will fix this. We'll see what other problems/solutions this introduces down the road!

    Hello all,

    I'm trying to build a little pixel-art type game in a tiny window and running into a problem. When my sprite moves (currently have 8-direction movement in place), it sometimes looks blurry (ugly). I checked out the debugging window, and it looks like this is being caused by it stopping between pixels so Construct tries to mix everything together, creating mushy graphics.

    <img src="http://i.imgur.com/h6Q68.png">

    Is there any simple way to fix this? Off the top of my head, it seems like making movement only happen in whole-pixel (read: integer) increments will fix this, but I have no idea how to go about doing that. Also, I plan on replacing 8-direction movement to something controlled automatically, so I'd like something that isn't behavior-dependent, or at least is easy to apply to any movement behavior.

    (And I promise, I'll replace Ness with something less stolen by the time I have something functional!)

J3ff0's avatar

J3ff0

Member since 5 May, 2010

None one is following J3ff0 yet!

Trophy Case

  • 14-Year Club

Progress

14/44
How to earn trophies