Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Temp

Pages: [1]
1
General / Re: How to make a semi-transparent window?
« on: November 17, 2014, 12:32:02 am »
Wow guys, thanks for the detailed replies!!

I can't really check these examples rihgt now but check them out as soon as I can. I was almost thinking of just using TideSDK to all the stuff but now i'll have to research some more about what I really need to use for my program.

Thanks again!

2
General / Re: How to make a semi-transparent window?
« on: November 15, 2014, 02:52:51 am »
Awww.... Well I hope there is someone here who had a bit of code example to show me who they handled this problem.. But thanks for the reply!!

3
General / How to make a semi-transparent window?
« on: November 14, 2014, 08:16:14 am »
Hi!

I've was trying to find a solution for this problem all around but still couldn't find it. Tried a bunch of stuff but they all result in the same window with opaque colors(Might be because I'm still a noob  :'().

So what I want to do it have a borderless window without any title bar and stuff and have the window itself also be  semi-transparent or may be have a repeating semi-transparent image. Something similar to rainmeter skins.. I have my base code below. Let me know if you want to clear something out. Thanks!

#include "stdafx.h"
#include <SFML/Graphics.hpp>
#include <iostream>

int main()
{
        sf::RenderWindow window(sf::VideoMode(800, 600), "", sf::Style::None);
        sf::Vector2i grabbedOffset;
        sf::Texture texture;
        if (!texture.loadFromFile("BlackBG.png", sf::IntRect(10, 10, 32, 32)))
        {
                std::cout << "count not load image" << std::endl;
        }
        sf::Sprite sprite;
        sprite.setTexture(texture);


        bool grabbedWindow = false;
        while (window.isOpen())
        {
                sf::Event event;
                while (window.pollEvent(event))
                {
                        if (event.type == sf::Event::Closed)
                                window.close();
                        else if (event.type == sf::Event::KeyPressed)
                        {
                                if (event.key.code == sf::Keyboard::Escape)
                                        window.close();
                        }
                        else if (event.type == sf::Event::MouseButtonPressed)
                        {
                                if (event.mouseButton.button == sf::Mouse::Left)
                                        grabbedOffset = window.getPosition() - sf::Mouse::getPosition();
                        }
                }
               
                sprite.setColor(sf::Color(255, 255, 255, 128)); // half transparent

                window.clear(sf::Color(0, 200, 0, 10));

                grabbedWindow = sf::Mouse::isButtonPressed(sf::Mouse::Left);
                if (grabbedWindow)
                        window.setPosition(sf::Mouse::getPosition() + grabbedOffset);

                window.display();
        }
}
 

Pages: [1]