Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (AndrewAMD, Nymphodora, Quad, TipmyPip, Imhotep), 852 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 5 of 6 1 2 3 4 5 6
Re: Imgui Lite-c Development [Re: Evo] #479604
04/10/20 03:39
04/10/20 03:39
Joined: Feb 2003
Posts: 146
RP China
2
20BN Offline
Member
20BN  Offline
Member
2

Joined: Feb 2003
Posts: 146
RP China
@Emre

Thank you!
And how to display CHS / CHT text and change any font in this imgui demo?

Re: Imgui Lite-c Development [Re: 20BN] #479606
04/10/20 05:18
04/10/20 05:18
Joined: Jul 2007
Posts: 619
Turkey, Izmir
Emre Offline
User
Emre  Offline
User

Joined: Jul 2007
Posts: 619
Turkey, Izmir
Originally Posted by 20BN
@Emre

Thank you!
And how to display CHS / CHT text and change any font in this imgui demo?

You are welcome. i've changed/updated the link yesterday. Now the rar file contain source code. You can change anything you want. wink

Re: Imgui Lite-c Development [Re: Emre] #479607
04/10/20 11:34
04/10/20 11:34
Joined: Feb 2003
Posts: 146
RP China
2
20BN Offline
Member
20BN  Offline
Member
2

Joined: Feb 2003
Posts: 146
RP China
Originally Posted by Emre
Originally Posted by 20BN
@Emre

Thank you!
And how to display CHS / CHT text and change any font in this imgui demo?

You are welcome. i've changed/updated the link yesterday. Now the rar file contain source code. You can change anything you want. wink


OK! I'm use imgui_add_ttf_from_file("zz.ttf", 16, 0); change any font.
But, not support display Simplified Chinese or Japanese text.(error show: ?????? )
What should I script?

Re: Imgui Lite-c Development [Re: 20BN] #479608
04/10/20 12:50
04/10/20 12:50
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
Hi,
The last parameter of 'imgui_add_ttf_from_file' is a ImGui preset of ranges of glyphs. For full chinesse should be 1, and for simplified 2. You can find the defines at 'imgui_helpers.h'.

You can build yor own glyph ranges with 'imgui_add_ttf_from_file_ranged' where the last parameter is an array of shorts with all the ranges from unicode table ended with a null entry.

The array should look something like this:
Code
short  myGlyphRanges[7] = {
   30, 127,            // Latin1 basic
   2087, 3048,      // Imaginary range as example
   16524, 16524,  // A single character range
   0                       // array ended with a null entry
}
...
imgui_add_ttf_from_file_ranged("myFont.ttf", 16, myGlyphRanges);


I did not try with chinesse, but cyrillic was working perfectly.

The glyph range of my main project looks like the following. I included all the latin characters, some of the symbols and a piece of the private area:
Code
short glyphRanges[23] = {
//	0x0000, 0x001F, // Control characters
	0x0020, 0x007F, // Basic Latin
//	0x0080, 0x00FF, // Latin supplement
		0x00A0, 0x00FF,
	0x0100, 0x017F, // Latin extended-A
	0x0180, 0x024F, // Latin extended-B
//	0x02B0, 0x02FF, // Spacing modifier letters
		0x02C0, 0x02DF,
//	0x2000, 0x206F, // General punctuation
		0x2010, 0x2027,
		0x2030, 0x205E,
//	0x20A0, 0x20CF, // Currency symbols
		0x20AC, 0x20AC,
//	0x2100, 0x214F, // Letterlike symbols
		0x2122, 0x2122,
//	0x2600, 0x26FF, // Miscellaneous symbols
		0x2600, 0x2647,
//	0xE800, 0xE8FF, // Private use area
		0xE800, 0xE808,
	0
};


I used hexadecimal notation because it is the common way to refer to unicode characters

I hope it helps,
Salud!

Re: Imgui Lite-c Development [Re: Evo] #479830
04/28/20 16:20
04/28/20 16:20
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Hey guys!

Do any of you know, how to disable filtering for images?
Also, is there any way to set custom 'flag' (check?) image for checkboxes:
[Linked Image]
I couldn't really find anything about this over the web...

Greets

Last edited by 3run; 04/28/20 16:20.

Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Imgui Lite-c Development [Re: 3run] #479832
04/28/20 23:20
04/28/20 23:20
Joined: Jul 2007
Posts: 619
Turkey, Izmir
Emre Offline
User
Emre  Offline
User

Joined: Jul 2007
Posts: 619
Turkey, Izmir
Originally Posted by 3run
Also, is there any way to set custom 'flag' (check?) image for checkboxes:

You mean custom checkmark? Afaik imgui has no such an option. This is the function which draw checkmarks;

Code
void ImGui::RenderCheckMark(ImVec2 pos, ImU32 col, float sz)
{
    ImGuiContext& g = *GImGui;
    ImGuiWindow* window = g.CurrentWindow;

    float thickness = ImMax(sz / 5.0f, 1.0f);
    sz -= thickness*0.5f;
    pos += ImVec2(thickness*0.25f, thickness*0.25f);

    float third = sz / 3.0f;
    float bx = pos.x + third;
    float by = pos.y + sz -third * 0.5f;
    window->DrawList->PathLineTo(ImVec2(bx - third, by - third));
    window->DrawList->PathLineTo(ImVec2(bx, by));
    window->DrawList->PathLineTo(ImVec2(bx + third*2, by - third*2));
    window->DrawList->PathStroke(col, false, thickness);
}


You can change the shape for sure. I don't know if there is a way to load a custom image. Maybe you can try to use "window->DrawList->AddImage" instead of "window->DrawList->PathLineTo" but i'm not sure if this is safe and will work.

in any case, you'll have to create your own dll to do something like this.

Re: Imgui Lite-c Development [Re: Evo] #479834
04/29/20 09:30
04/29/20 09:30
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Thank you! laugh

I also read that in previous versions imgui used square instead of a checkmark, maybe I could try to find older version.
What about image filtering, what do you think? Will that also require building own dll?

Edit: I think I found old version of RenderCheckMark function (if someone interested)
Nope, it doesn't work... So I left the checkmark as it is, tried to draw X but failed grin

And for disabling linear filtering, indeed, changing D3DTEXF_LINEAR to D3DTEXF_NONE in imgui_impl_dx9.cpp works.
Code
g_pd3dDevice->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_NONE);
g_pd3dDevice->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_NONE);

Last edited by 3run; 04/29/20 15:37. Reason: compiled my own .dll

Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Imgui Lite-c Development [Re: Evo] #480508
06/12/20 01:23
06/12/20 01:23
Joined: Apr 2005
Posts: 795
U.S.A. Michigan
exile Offline
User
exile  Offline
User

Joined: Apr 2005
Posts: 795
U.S.A. Michigan
Hey all. Having some issues with imgui_add_ttf_from_file. Trying to use the previously provided examples in the demo but the font either doesn't change or causes an immediate crash. Before the imgui_begin function I am defining;

ImFont *ImFont01 = imgui_add_ttf_from_file("c:\\Windows\\Fonts\\FuturBlock-Regular.ttf", 18, GLYPH_RANGE_Default);

Then in the function I am calling it as;

imgui_push_font(ImFont01);
imgui_text("Test\r\n");
imgui_pop_font();

Any idea on what I am doing wrong?

Re: Imgui Lite-c Development [Re: 20BN] #480514
06/12/20 07:30
06/12/20 07:30
Joined: Feb 2003
Posts: 146
RP China
2
20BN Offline
Member
20BN  Offline
Member
2

Joined: Feb 2003
Posts: 146
RP China
[Linked Image]

Hello,
Can DLL currently implement this kind of node UI?

Re: Imgui Lite-c Development [Re: exile] #480526
06/12/20 20:18
06/12/20 20:18
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
@exile
I experimented some crashes when font do not contain the glyphs stated in the array. Did you try with other fonts?

Page 5 of 6 1 2 3 4 5 6

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1