Resizing window..

For questions about using Classic.

Post » Fri Jul 02, 2010 6:26 pm

Is it possible to resize the window of a direct X game without the image interpolation / blurriness? It's ruining my graphics! :? I'm using the window object btw, not dragging the window.
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Fri Jul 02, 2010 7:40 pm

[quote="Tokinsom":ubswi8d1]Is it possible to resize the window of a direct X game without the image interpolation / blurriness? It's ruining my graphics! :? I'm using the window object btw, not dragging the window.[/quote:ubswi8d1]

application properties -> scroll down to runtime properties if you have to -> sampling -> change to "point" and there you go!

edit: also you might wanna consider changing the text rendering to aliased. cheers!
B
81
S
50
G
10
Posts: 555
Reputation: 13,009

Post » Fri Jul 02, 2010 7:51 pm

Thanks for the quick reply! However, I'm already using point sampling. What happens is even though I'm using point sampling, the graphics become distorted/blurry after resizing the window; as If I've chosen linear sampling instead. Any idea how that can be fixed?
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Sat Jul 03, 2010 4:49 am

[quote="Tokinsom":31r1biom]... What happens is even though I'm using point sampling, the graphics become distorted/blurry after resizing the window; as If I've chosen linear sampling instead. Any idea how that can be fixed?[/quote:31r1biom]
That happens if you just change the window size without changing the display size while in the properties you have "Resizing" set to "Disabled" or "Stretch window content"

My best experience to date was to use System: Set display resolution (More of your game will be revealed or black borders, if you have smaller layouts), esp. when switching during gametime. This action sets the window size automatically in relation to the new resolution, you just may need to reposition it.
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Sat Jul 03, 2010 5:30 am

I've been dabbling with resizing window on the fly without stretching the content, you'll want to use Window object (wait for next release, Davo's fixed the Window object to be much more useful :) )

And yes, System: Set display resolution works nicely.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Sat Jul 03, 2010 10:53 pm

I don't mean to be rude but changing the display resolution does the opposite of what I'm going for :mrgreen:;; It might come in handy for another option though..

I meant I DO want to stretch the display when resizing the window, but I don't want the interpolation that comes with it. Basically my game's window width and height is 256x224. I just want to stretch the window out to 512x448 or higher so it's easier to see. I used the window object and "set size" to achieve this, but like I said it automatically messes with the graphics and makes them blurry. With that said, is there a way to resize the window and it's contents without distorting the graphics?

Sorry for any confusion.
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Sun Jul 04, 2010 6:55 am

[quote="Tokinsom":2djes9dd]I don't mean to be rude but changing the display resolution does the opposite of what I'm going for :mrgreen:;; It might come in handy for another option though..

I meant I DO want to stretch the display when resizing the window, but I don't want the interpolation that comes with it. Basically my game's window width and height is 256x224. I just want to stretch the window out to 512x448 or higher so it's easier to see. I used the window object and "set size" to achieve this, but like I said it automatically messes with the graphics and makes them blurry. With that said, is there a way to resize the window and it's contents without distorting the graphics?

Sorry for any confusion.[/quote:2djes9dd]
You are not rude :)
Changing the display resolution does what you want (instead of resizing the window), you just need to rework the content to your needs (point sampling is still required, of course).
Your actual example as pseudo code:
+(Some trigger, eg On key pressed)
->System: Set layout size to 512x448
->System: Set zoom to (200, 200)
->System: Set display size to 512x448

The only thing left to do is reposition the "camera", but that's dependant of what you want to show or what other events or plugins you use therefore, so I'll leave it out.
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Mon Jul 05, 2010 7:46 pm

I'm having problem with this as well.

I managed to set display resolution, then zoom in. But no matter how hard I try, I cannot reach the border of my layout (I have a sprite with "scroll to X and Y").

Of course I can turn unbounded scrolling to do this, but I'd like to come up with a clean solution to that :-P

Do you guys know what's going on?

EDIT:
Ok, I found this... Looks like I have to go with the Unbounded Scrolling anyway... :-(
viewtopic.php?f=17&t=2331&start=0&hilit=double+window+size
B
107
S
40
G
10
Posts: 456
Reputation: 13,202

Post » Mon Jul 05, 2010 8:42 pm

With unbounded scrolling on, do this to scroll to Sprite but not scoll past the edges of the layout.
[code:d47dogvp]+ System: Always (every tick)
-> System: Scroll to X Clamp(Sprite.X, (ScrollXRight-ScrollXLeft)/2, LayoutWidth-(ScrollXRight-ScrollXLeft)/2)
-> System: Scroll to Y Clamp(Sprite.Y, (ScrollYBottom-ScrollYTop)/2, LayoutHeight-(ScrollYBottom-ScrollYTop)/2)[/code:d47dogvp]

Or for example you have a layout of size 640x480 and set the zoom to 200,200 then:
[code:d47dogvp]+ System: Always (every tick)
-> System: Scroll to X Clamp(Sprite.X, 160, 480)
-> System: Scroll to Y Clamp(Sprite.Y, 120, 360)[/code:d47dogvp]
B
79
S
24
G
54
Posts: 4,735
Reputation: 40,733


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests