Main Menu
Menu

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.

Show posts Menu

Messages - DJuego

#1
Feature requests / Re: Menu with checks/checkbox
30 January 2023, 21:50:27
Indeed!! Thank you very much (again) for the trick!
I've tried it and it works like a charm! And it fulfills my purposes. And although more convoluted, it fulfills my purposes perfectly.

 :-*


DJuego
#2
Feature requests / Menu with checks/checkbox
30 January 2023, 13:31:45
First of all, thank you very much for this very powerful contribution, texus!!

Almost anyclassic widget I could possibly need I can find. But sometimes the need arises for some very particular widget that solves a specific problem almost perfectly.

This is the case of menus with checks.



DJuego

PS: In my case I would like to use it to control the visibility of groups of sprites (9 groups of five sprites each).  :)
 


#3
Thank you very much for your quick response!  :D

First of all thank you for the great effort you have put into TGUI. It is a GUI that I love! I recently upgraded to 0.9.1 (I actually use the "master") and it just keeps getting better and better. I am also delighted with the gui-builder. It helps a lot!!  :-*

I suspected it. I understand this TGUI limitation. I had several alternatives in mind but the one you have proposed is by far the best. I have tested portable-file-dialogs and it does perfectly what I wanted. Also, I like its simplicity and header-only nature. Thanks for that too!

DJuego
#4
Hi! I am using the new FileDialog Widget for the first time.  I can manipulate the dialog box inside the RenderWindow. Good.

However I am not able to create the dialog box in a separate, independent window that I can move freely across the desktop.  :( Maybe it is not possible? And if possible, can you direct me to an example code?

An animated GIF showing the result obtained so far: https://gfycat.com/tinykeydowitcher

Thanks!

DJuego

#5
Indeed! Thank you for your answer, texus!

Very soon after asking the question I managed to code a satisfactory solution myself.
I planned to publish the solution I found, and thus contribute to the community. But the life delayed me. I'm sorry. :-(

Anyway, it's not perfect, because I can't load the alpha channel of the PNG images. But I know that the problem has nothing to do with SFML or TGUI.

I paste the current code (for now):


m_imagen.load("recursos/imagen_png.png");
//m_imagen.load("recursos/imagenBN_jpg.jpg");
//m_imagen.load("recursos/imagen_jpg.jpg");

sf::Image imagen;
imagen.create(m_imagen.width(), m_imagen.height(), sf::Color::Black);

switch (m_imagen.spectrum())
{
case 0:
{
//The image is empty


}
break;

case 1:  //Grayscale image
{
for (std::size_t i = 0; i < m_imagen.width(); ++i)
{
for (std::size_t j = 0; j < m_imagen.height(); ++j)
{
sf::Color color = sf::Color(m_imagen(i, j, 0, 0), m_imagen(i, j, 0, 0), m_imagen(i, j, 0, 0), 255);
imagen.setPixel(i, j, color);
}
}
}
break;
case 3:   //The image is RGB
{
for (std::size_t i = 0; i < m_imagen.width(); ++i)
{
for (std::size_t j = 0; j < m_imagen.height(); ++j)
{
sf::Color color = sf::Color(m_imagen(i, j, 0, 0), m_imagen(i, j, 0, 1), m_imagen(i, j, 0, 2), 255);
imagen.setPixel(i, j, color);
}
}
}
break;

case 4: //The image is RGBA?
{
for (std::size_t i = 0; i < m_imagen.width(); ++i)
{
for (std::size_t j = 0; j < m_imagen.height(); ++j)
{
sf::Color color = sf::Color(m_imagen(i, j, 0, 0), m_imagen(i, j, 0, 1), m_imagen(i, j, 0, 2), m_imagen(i, j, 0, 3));
imagen.setPixel(i, j, color);
}
}
}
break;

default:

break;
}



sf::Texture textura;
textura.loadFromImage(imagen);

tgui::Picture::Ptr panoramica = m_gui_principal.get<tgui::Picture>("Picture1");
panoramica->getRenderer()->setTexture(textura);




DJuego

P.S: Thank you for your commitment to the forum.

#6
Help requests / Conversion from CImg to TGUI
28 March 2020, 15:57:08
Windows 10. Microsoft Visual Studio 2019

Hi. I'm new to CImg.

I'm trying to load images into SFML from CImg. My idea is that CImg will take care of the image processing while the interface is developed based on SFML (more specifically with TGUI. For example in a PictureBox.). Has anyone tried this conversion successfully?

My attempts have been unsuccessful. For example; this code produces an exception.


cimg_library::CImg<unsigned char> image_cimg("recursos/imagen_png.png");

sf::Image image_sfml;
image_sfml.create(image_cimg.width(), image_cimg.height(), image_cimg.data());


Any idea?
Thank you!

DJuego
#7
Installation help / Re: tgui master.
11 April 2018, 01:58:10
Thank you again for your inmediate support, texus. (And thanks for answering my question)

This is my last script version. It works!

Quote[...] But for finding the latest SFML version it is recommended to just keep SFML_ROOT and CMAKE_MODULE_PATH empty and set the SFML_DIR to the SFML build directory (or the location where it was installed)

With "Debug mode" release

cmake -G 'NMake Makefiles' -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX=$DIRECTORIO_INSTALACION_LIBRERIA -D SFML_DIR=$DIRECTORIO_INSTALACION/SFML/lib/cmake/SFML -D TGUI_BUILD_DOC:BOOL=ON -D TGUI_BUILD_EXAMPLES:BOOL=ON -D TGUI_BUILD_TESTS:BOOL=OFF -D TGUI_BUILD_GUI_BUILDER:BOOL=ON -D DOXYGEN_EXECUTABLE=$ARCHIVO_DOXYGEN ../..
[/code]

With "Release mode" release

cmake -G 'NMake Makefiles' -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=$DIRECTORIO_INSTALACION_LIBRERIA -D SFML_DIR=$DIRECTORIO_INSTALACION/SFML/lib/cmake/SFML -D TGUI_BUILD_DOC:BOOL=ON -D TGUI_BUILD_EXAMPLES:BOOL=ON -D TGUI_BUILD_TESTS:BOOL=OFF -D TGUI_BUILD_GUI_BUILDER:BOOL=ON -D DOXYGEN_EXECUTABLE=$ARCHIVO_DOXYGEN ../..   


#8
Installation help / Re: tgui master.
10 April 2018, 23:04:30
texus, Thank you for your very swift answer! I am using 0.8-dev (l like the danger).

Yes. I am using SFML_ROOT.

With "Debug" release

cmake -G 'NMake Makefiles' -D CMAKE_BUILD_TYPE=Debug -D CMAKE_MODULE_PATH=$DIRECTORIO_INSTALACION/SFML/cmake/Modules -D CMAKE_INSTALL_PREFIX=$DIRECTORIO_INSTALACION_LIBRERIA -D SFML_INCLUDE_DIR=$DIRECTORIO_INSTALACION/SFML/include -D SFML_ROOT=$DIRECTORIO_INSTALACION/SFML -D TGUI_BUILD_DOC:BOOL=ON -D TGUI_BUILD_EXAMPLES:BOOL=ON -D TGUI_BUILD_TESTS:BOOL=OFF -D TGUI_BUILD_GUI_BUILDER:BOOL=ON -D DOXYGEN_EXECUTABLE=$ARCHIVO_DOXYGEN ../.. [/td]


With "Release" release
cmake -G 'NMake Makefiles' -D CMAKE_BUILD_TYPE=Release -D CMAKE_MODULE_PATH=$DIRECTORIO_INSTALACION/SFML/cmake/Modules -D CMAKE_INSTALL_PREFIX=$DIRECTORIO_INSTALACION_LIBRERIA -D SFML_INCLUDE_DIR=$DIRECTORIO_INSTALACION/SFML/include -D SFML_ROOT=$DIRECTORIO_INSTALACION/SFML -D TGUI_BUILD_DOC:BOOL=ON -D TGUI_BUILD_EXAMPLES:BOOL=ON -D TGUI_BUILD_TESTS:BOOL=OFF -D TGUI_BUILD_GUI_BUILDER:BOOL=ON -D DOXYGEN_EXECUTABLE=$ARCHIVO_DOXYGEN ../..


Now i have changed to:

cmake -G 'NMake Makefiles' -D CMAKE_BUILD_TYPE=Debug -D CMAKE_MODULE_PATH=$DIRECTORIO_INSTALACION/SFML/cmake/Modules -D CMAKE_INSTALL_PREFIX=$DIRECTORIO_INSTALACION_LIBRERIA -D SFML_INCLUDE_DIR=$DIRECTORIO_INSTALACION/SFML/include -D SFML_DIR=$DIRECTORIO_INSTALACION/SFML/lib/cmake/SFML -D TGUI_BUILD_DOC:BOOL=ON -D TGUI_BUILD_EXAMPLES:BOOL=ON -D TGUI_BUILD_TESTS:BOOL=OFF -D TGUI_BUILD_GUI_BUILDER:BOOL=ON -D DOXYGEN_EXECUTABLE=$ARCHIVO_DOXYGEN ../..


and

cmake -G 'NMake Makefiles' -D CMAKE_BUILD_TYPE=Release -D CMAKE_MODULE_PATH=$DIRECTORIO_INSTALACION/SFML/cmake/Modules -D CMAKE_INSTALL_PREFIX=$DIRECTORIO_INSTALACION_LIBRERIA -D SFML_INCLUDE_DIR=$DIRECTORIO_INSTALACION/SFML/include -D SFML_DIR=$DIRECTORIO_INSTALACION/SFML/lib/cmake/SFML -D TGUI_BUILD_DOC:BOOL=ON -D TGUI_BUILD_EXAMPLES:BOOL=ON -D TGUI_BUILD_TESTS:BOOL=OFF -D TGUI_BUILD_GUI_BUILDER:BOOL=ON -D DOXYGEN_EXECUTABLE=$ARCHIVO_DOXYGEN ../..


and it works very well, but there are a new error in "installation"

[...]
-- Installing: W:/Archivos_de_Programa/MSVC2017/x64/TGUI/./themes/Black.png
-- Installing: W:/Archivos_de_Programa/MSVC2017/x64/TGUI/./themes/Black.txt
CMake Error at cmake_install.cmake:52 (file):
  file INSTALL cannot find
  "P:/Compilados/x32-x64/TRABAJO_MSVC2017_x64/TGUI/cmake/Modules/FindTGUI.cmake".




DJuego

P.S: By the way, when do you plan to release the new stable version 0.8? :-D
#9
Installation help / tgui master.
10 April 2018, 22:25:47
Hi! I just registered. Thank you for tgui! I've used it several times and it's great. I always build the master branch and I have not had problems for a long time. I use a script. However in the last weeks a problem has appeared.


Instalacion TGUI en x64
-- The C compiler identification is MSVC 19.13.26128.0
-- The CXX compiler identification is MSVC 19.13.26128.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.13.26128/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.13.26128/bin/Hostx64/x64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.13.26128/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.13.26128/bin/Hostx64/x64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of void*
-- Check size of void* - done
CMake Warning at CMakeLists.txt:171 (find_package):
  By not providing "FindSFML.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "SFML", but
  CMake did not find one.

  Could not find a package configuration file provided by "SFML" (requested
  version 2) with any of the following names:

    SFMLConfig.cmake
    sfml-config.cmake

  Add the installation prefix of "SFML" to CMAKE_PREFIX_PATH or set
  "SFML_DIR" to a directory containing one of the above files.  If "SFML"
  provides a separate development package or SDK, be sure it has been
  installed.


CMake Error at CMakeLists.txt:184 (message):
  CMake couldn't find SFML.

  Either set SFML_DIR to the directory containing SFMLConfig.cmake or set the
  SFML_ROOT entry to SFML's root directory (containing "include" and "lib"
  directories).


-- Configuring incomplete, errors occurred!
See also "P:/Compilados/x32-x64/TRABAJO_MSVC2017_x64/TGUI/builds/debug/CMakeFiles/CMakeOutput.log".




I do not know if they are due to changes in SFML (branch master) or tgui (branch master). (?) I work in Windows 10 x64 with Visual Studio 2017.
Interestingly, if I configure and generate the files with cmake-gui (without changes), it works!

Any idea? Thanks!

DJuego