Windows shape question

For questions about using Classic.

Post » Wed Feb 02, 2011 5:58 pm

Is there a way to create a shaped or translucent window with Construct?.MMF has the window shape object which wil let you create a shape of the sprite's mask.For example : Like those desktop buddy
apps etc..Can this be achieved through Python Scripting and if so please show me an example of how this can be done through python.
B
22
S
3
G
6
Posts: 1,356
Reputation: 7,141

Post » Wed Feb 02, 2011 6:15 pm

You asked this question last year, and RojoHound came up with the answer.
You even got it working and posted a cap demonstrating it.

viewtopic.php?f=3&t=7515&p=58466

Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Wed Feb 02, 2011 7:00 pm

[quote="KrushBrother":35lq4n81]You asked this question last year, and RojoHound came up with the answer.
You even got it working and posted a cap demonstrating it.

viewtopic.php?f=3&t=7515&p=58466

Krush.[/quote:35lq4n81]

Um I know ,This is a different question.Its not about the shape of the window anymore but the mask of the sprite making up the shape of the window,Im asking about the mask of the sprite not just the window shape.
B
22
S
3
G
6
Posts: 1,356
Reputation: 7,141

Post » Thu Feb 03, 2011 1:11 am

Hmm, so you are. :lol:

I don't think the ctypes library supports it.

In visual basic years ago, we used to create the transparent area in script merging multiple regions, but it wasn't advisable for complex shapes because of the resources it used.
I'm sure Rojo will get back to you with something, but in the meantime take a look at the WSO library.

http://www.veretennikov.org/WSO/Help/ht ... 8fdd5c76c2

It has all the usual functions for regions, like ctypes has, but take a look at the bottom one.
[color=#BF0000:34m63eoh]CreateRgnFromImage[/color:34m63eoh]
It allows the use of a mask, and it's Python compatible, so it should do what you want.

I haven't used that library for that purpose, so I'll be interested to know how it goes.

Cheers,
Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Thu Feb 03, 2011 6:04 am

I was able to make an arbitrary shaped window by combining many single pixel regions but as KrushBrother said it ended up being intolerably slow. There is another method for making windows transparent called layered windows, but I haven't been able to get it to work correctly, it seems to be conflicting with the direct3d surface. I'll have another look at it and see what I can come up with.

Reference of ways to make window transparent:
http://www.flipcode.com/archives/Win32_ ... ning.shtml
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Thu Feb 03, 2011 7:07 am

Thanks for the info Krushbrother and Rojohound.
B
22
S
3
G
6
Posts: 1,356
Reputation: 7,141

Post » Sat Feb 05, 2011 9:12 pm

Tried some of those theories out on CS and i failed miserably,Then i used another 2d games creation package to see if i could suceed and voila it worked like a charm on the "other" program even got the sprite to walk,Run and fall when you drag and drop it onto the desktop.

The Other program im talking about is called Game Maker pro 8.0.And so i studied the extension file and the dll file to see how they achieved this.The backdrop is a black and white picture where only the white shows on the desktop.The second file is the texture or picture almost like the diffuse and opacity feature that daz3d uses.

But i will carry on and keep experimenting with this on Construct until i get it right.Unfortunately i cannot create a plugin for Construct because my visual basic 2008 pro is screwing around again.It looks like a plugin would be the most viable option to achieve this.That's why i love Construct so much,The "how the ^&*%$# do i do that to getting that warm and fuzzy feeling when you actually solve the problem ,It's way better than playing games lol.
B
22
S
3
G
6
Posts: 1,356
Reputation: 7,141

Post » Sun Feb 06, 2011 12:19 am

Here is the unacceptably slow way I have found to make custom shaped windows:
[url:2y944prw]http://dl.dropbox.com/u/5426011/examples3/customwindow.cap[/url:2y944prw] made in 0.99.96

The main bottleneck is generating the region, so a fully dynamic window is not possible with this method. In order for this to be usable for large windows the region would have to pre-generated... yet another can of worms.
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Sun Feb 06, 2011 10:11 am

Thnx for the demo cap rojohound,I see what you mean by slow.I will experiment some more and see if i can speed up the region generation.With my own experiments the region generation is acceptable but then it causes the desktop to freeze up and the prog would crash.
B
22
S
3
G
6
Posts: 1,356
Reputation: 7,141

Post » Mon Feb 07, 2011 1:38 am

I updated the example in my previous post. I found a way to generate the window shape faster, but more importantly I implemented the ability to save and load the regions to/from files. Loading is almost instant so pre-generating the window shapes into files is the way to go if you want custom shaped windows.
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests