Windows shape question

This forum is currently in read-only mode.
From the Asset Store
Get Ready for the New Wave of "Bottom Screen" Games!
  • 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.

  • You asked this question last year, and RojoHound came up with the answer.

    You even got it working and posted a cap demonstrating it.

    Krush.

  • You asked this question last year, and RojoHound came up with the answer.

    You even got it working and posted a cap demonstrating it.

    Krush.

    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.

  • Hmm, so you are.

    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.

    CreateRgnFromImage

    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.

  • 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

  • Thanks for the info Krushbrother and Rojohound.

  • 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.

  • Here is the unacceptably slow way I have found to make custom shaped windows:

    http://dl.dropbox.com/u/5426011/examples3/customwindow.cap 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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.

  • Way to go Rojohound.Now for the next challenge,Let the character have animations on the desktop.Like walking or a falling animation when you drop the character.I love it when Someone says "No it cannot be done in CS" And then someone goes and prove's them wrong.Rojo you are a genius thank you for your help.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)