Jump to content


Photo

Pixel Perfect Resizing


  • Please log in to reply
66 replies to this topic

#61 PHL

PHL

    GMC Member

  • GMC Member
  • 170 posts

Posted 24 June 2011 - 12:15 PM

Is it DirectX that causes blurring ?

Edited by PHL, 24 June 2011 - 12:16 PM.

  • 0

#62 OldSkoolGamer

OldSkoolGamer

    GMC Member

  • GMC Member
  • 90 posts
  • Version:GM:Studio

Posted 26 June 2011 - 03:18 AM

Is it DirectX that causes blurring ?


Yes, it's a by-product of 2D hardware acceleration, done WAY back i the early Direct-X days, I believe it's bi-linear interpolation.
  • 0

#63 andreasng

andreasng

    GMC Member

  • GMC Member
  • 90 posts

Posted 03 July 2011 - 04:29 PM

yoyo should really take care of this nativly. It is unacceptable in 2011 that this hasn't been implemented yet, given the focus on retro games, with tech such as flixel.

yoyo: this should be a free update. Don't wait for next release.
  • 0

#64 Captain_Capitalism

Captain_Capitalism

    GMC Member

  • GMC Member
  • 216 posts

Posted 04 July 2011 - 08:03 AM

Thank you so much for this. I used to use a simple method of having a view size on screen twice as large as the view in room, but lately that's started giving me issues. This fixes everything and is incredibly easy to use once implemented. Thanks!

EDIT: Ok, I did find one thing I can't figure out, although I'm sure it's simple. When zoomed, mouse_x and mouse_y get fouled up - they report where the mouse would be on the unscaled screen, rather than the scaled-up version. Creating an object that follows the mouse will work when the mouse is at the 0,0 screen coord(regardles of where the view is), but it gets exponentially farther away from the mouse the farther from 0,0 it gets. I was able to easily replicate this in your example file. How should this be addressed?

EDIT 2: I figured out something.

Edited by Captain_Capitalism, 04 July 2011 - 10:43 AM.

  • 0

#65 fawful

fawful

    dear leader

  • GMC Member
  • 1321 posts
  • Version:GM8

Posted 16 February 2012 - 07:44 PM

I know this thread is a billion years old but if you're still reading this, 9_6, would you mind adressing an issue I've ran into using this?

You see in my game I need to get the colour of the background in certain position. But there may be things in front of it, so in an alarm event I periodically draw the background over everything and use draw_get_colour or whatever it's called. Using GM's native drawing system this doesn't show up at all but using this it manifests itself as an annoying flash.

Is there any way to stop drawing things I don't want to see or should this not happen?

:edit:

I can draw things in the step event and they show up, unscaled and transparent, on screen.

Posted Image

So I can draw outside the draw event and see things I shouldn't.

What do?

Edited by fawful, 25 February 2012 - 09:43 PM.

  • 0

#66 Lazy Brain Games

Lazy Brain Games

    GMC Member

  • GMC Member
  • 114 posts

Posted 24 April 2013 - 06:14 PM

Great script! Extremely useful! I got it up and running for rooms that don't use views in mere minutes! For rooms with views however, I'm not quite sure how to go about it.

 

"You have to make your own system for view handling."

 

I attempted something easy, like just having my camera object (the object the view should follow) have this in the step event:

 

view_xview[0]=x-120

 

there's no vertical movement (save for a few camera shakes) but when using this, it goes for a tiny little bit, and then the game freezes. Since I'm not getting a crash log or anything, I'm not sure where to go next in developing a system for view handling.

 

I know this topic is old, but maybe somebody has an idea what type of system would work?

 

Cheers,

 

-JB

 

[EDIT]

 

I might of posted this too soon! It seems to have something to do with the fact that I'm deactivating things based on the view! Trying to sort it out now ;)

 

[EDIT]

Just had to activate global.screencontroller! Awesome! :D


Edited by Lazy Brain Games, 24 April 2013 - 07:02 PM.

  • 0

#67 TheouAegis

TheouAegis

    GMC Member

  • GMC Member
  • 4733 posts
  • Version:GM8

Posted 26 April 2013 - 02:36 AM

I think my graphics cards hate scaling surfaces, because when I wrote up a custom room transition, I was getting stray rows or columns of pixels. I was like, "Why ain't this lining up right?" I'd check my numbers and everything lined up right except for one stray row or column of pixels. It only rally mattered I think when using draw_rectangle() though. I'd draw a 16x16xscale_factor rectangle, for example, and it wouldn't cover up the 16x16xscale_factor image on the surface no matter what coordinates I used for the rectangle. But if I used a view scale factor of 3:1, the rectangle would raw just fine. Oh well, i might try this code out and see what it does for my games.


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users