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 - Hexile

#16
Yea, that works. All is good now. :)
#18
it's pretty long, added it as attachment.
#19
I see. But it only works towards maximum, i would have expected it to work both ways
#20
Ah, found a reliable way to trigger it; It happens when clicking on the area not specified, i.e:



Most of the time it sets the knob to near/at maximum level
#21
tgui::Knob::Ptr knob1(gui);
knob1->load("data/widgets/Knob/Knob.conf");
knob1->setPosition(55, 235);
knob1->setSize(40, 40);
knob1->setStartRotation(127);
knob1->setValue(0);
knob1->setEndRotation(-128);
knob1->setMinimum(0);
knob1->setMaximum(127);
#22
I see.

There is a minor glitch with the knobs; the first time they are clicked, they jump to what seems to be a random point above half of the maximum value set.
#23
Fixed. a quick question though: is it possible to change the color of a widget like SFML can do on sprites?

I.e: sprite.setColor(sf::Color(0, 255, 0)); // green
#24
I have 8 knobs and 8 scrollbars in my project but i keep running into issues when i try to sync them.

Working:
Default/Inverted Mode: Knob operates Scrollbar
Inverted Mode: Knob operates Scrollbar
Not working:
Default Mode: Scrollbar operates Knob


How can i correctly sync changes between them?


Interesting bits of code:

const int vertical_control_separator = 100;

tgui::Scrollbar::Ptr scrollbar(gui);
scrollbar->load(THEME_CONFIG_FILE);
scrollbar->setVerticalScroll(true);
scrollbar->setPosition(20, 20);
scrollbar->setSize(18, 256);
scrollbar->setMaximum(127);
scrollbar->setLowValue(8);

tgui::Knob::Ptr knob(gui);
knob->load("data/widgets/Knob/Knob.conf");
knob->setPosition(55, 235);
knob->setSize(40, 40);
knob->setStartRotation(127);
knob->setValue(0);
knob->setEndRotation(-128);


/* Callback handling*/
#define Knob_CALLBACK_ID 10
#define KnobScroll_CALLBACK_ID 20

bool invert_Knob_SYNC=false;

knob->bindCallback(tgui::Knob::ValueChanged);
knob->setCallbackId(Knob_CALLBACK_ID +1);

syncbox->bindCallback(tgui::Checkbox::Checked);
syncbox->bindCallback(tgui::Checkbox::Unchecked);
syncbox->setCallbackId(Knob_CALLBACK_ID + 9);

scrollbar->bindCallback(tgui::Scrollbar::ValueChanged);
scrollbar->setCallbackId(KnobScroll_CALLBACK_ID + 1);


int value;

switch(callback.id)
{
// Knobs
case Knob_CALLBACK_ID + 1:
{
value=knob->getValue();

if (invert_Knob_SYNC == true) scrollbar->setValue(value / 3); // works but sync is flipped
else scrollbar->setValue((128 - 8) - (value / 3)); // default ( offset fixed)
break;
}

case Knob_CALLBACK_ID + 9:
{
invert_Knob_SYNC = !invert_Knob_SYNC;
break;
}

case KnobScroll_CALLBACK_ID + 1:
{
value = scrollbar->getValue();

if (invert_Knob_SYNC == true) knob8->setValue(value * 3); // works but sync is flipped
//else knob->setValue(? ); // broken
break;
}
#25
Oh. i thought what was a minimum version required. I have previously been using borland devcpp with a build setup pointing to the vs12/14 compiler so switching IDE takes some time...
#26
Replaced SFML with the VC12 version, it just changes the problem slightly:
Unhandled exception at 0x0FC3FA96 (sfml-system-d-2.dll) in tgui-test.exe: 0xC0000005: Access violation reading location 0xCCCCCCD8.
Exception thrown at 0x0FC3FA96 (sfml-system-d-2.dll) in tgui-test.exe: 0xC0000005: Access violation reading location 0xCCCCCCD8.
#27
Hi. this example hangs during runtime, below is info from VS debugger.

  • VS2015
  • TGUI 0.69 (VC12 32bit)
  • SFML 2.3.2 (VC14 32bit)
Unhandled exception at 0x00E82707 (sfml-system-d-2.dll) in tgui-test.exe: 0xC0000005: Access violation reading location 0xCCCCCCD8.
Exception thrown at 0x00E82707 (sfml-system-d-2.dll) in tgui-test.exe: 0xC0000005: Access violation reading location 0xCCCCCCD8.


Is there some details i have missed?