Giter VIP home page Giter VIP logo

Comments (6)

marcusva avatar marcusva commented on June 11, 2024

Original comment by Noel Luneburg (Bitbucket: noodleguitar, GitHub: noodleguitar):


I see the circle does not have smooth edges. I have the same problem when running testshape.c, regardless of whether I use an alpha mask or color key the background.

Is there a solution to this? Can the separation between picture (shaped window) and background be smoother?

from py-sdl2.

marcusva avatar marcusva commented on June 11, 2024

Original comment by swetarkshatak (Bitbucket: swetarkshatak, GitHub: Unknown):


when i run exe on command prompt...this show up unrecogenized...

from py-sdl2.

marcusva avatar marcusva commented on June 11, 2024

Original comment by Marcus von Appen (Bitbucket: marcusva, GitHub: marcusva):


SDL2's testshape.c is a console application, you need to pass the bitmap on the console:

testshape.exe yourbitmap.bmp

from py-sdl2.

marcusva avatar marcusva commented on June 11, 2024

Original comment by swetarkshatak (Bitbucket: swetarkshatak, GitHub: Unknown):


testshape.c not work on my visual studio...it out error -"SDL_Shape requires at least one bitmap file as argument."....please help me.where i put the path of bmp file in testshape.c ....

from py-sdl2.

marcusva avatar marcusva commented on June 11, 2024

Original comment by Mihail Latyshov (Bitbucket: kutu182, GitHub: Unknown):


thank you
i see the window now

from py-sdl2.

marcusva avatar marcusva commented on June 11, 2024

Original comment by Marcus von Appen (Bitbucket: marcusva, GitHub: marcusva):


You must give the window a position on the screen. By default, a shape window is set with a position off-screen (-1000, -1000) by SDL2.
It also must be made resizable via the flags.

#!python
window = ShapeWindow("Hello World!", (800, 500), (200, 200), sdl2.SDL_WINDOW_RESIZABLE)

Once done, after setting the window shape, you should set the size of the window to the size of the surface to render:

#!python
sdl2.SDL_SetWindowShape(window.window, circle_sf, shape_mode)
sdl2.SDL_SetWindowSize(window.window, circle.size[0], circle.size[1])

from py-sdl2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.