Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
@rrraptor Can you submit that so it can be in the next gideros build?
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
@rrraptor there is something strange with scaledimage, it renders over the child it should be in, see attached image (where an image overlaps with the button which has a house icon on it).
with the new scaledImageButton is there a way to set exactly the size of the image of the button (independent of the button)?
EDIT:i see that you intend to do this with "ImGui:pushStyleVar(ImGui.StyleVar_FramePadding, x, y)" so i shall make my own function which wraps these together so that i do not need to make my code much longer.
here is my quick and dirty extension:
function ImGui:scaledImageButtonPadded(v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15,v16)if v15~=nilthen self:pushStyleVar(ImGui.StyleVar_FramePadding,v15,v16)end
res=self:scaledImageButton(v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14)if v15~=nilthen self:popStyleVar()endreturn res
end
one more question related to the same. with my dirty padded button it looks as if 1,1 padding and fitHeight gave bigger padding on the top than on the bottom. see attached image.
the issue is even more apparent with 0,0 padding as there is a line at the top but nothing at the bottom.
another problem with this solution to resize inner image using padding is that the 'boundary' does not get the bg color of the image.
all in all there are 3 natural ways to use the bgcolor: 1. just image 2. image+rest of button area 3. image+rest of button area+padding i can imagine that scaledimagebutton gets too complicated after a while but it would nevertheless be nice to be able to choose between these 3 options. option 2 is what happens now i guess, option 3 can be achieved using some additional styling in my padded version but there is no way to do option 1, or am i wrong?
when using colorEdit3() in the popup i have two colors, current and original. yet in colorPicker3() i only have current. is there a way to show original also there? (i.e., my colorPicker3 outcome should be identical to the colorEdit3() outcome. thanks
i thought that a colorButton can automatically be the target of a drag-n-drop operation of a colorEdit3 but it is not the case. is that a bug? in other words: i can drop a colorEdit3 color on a colorButton but i cannot drop a colotButton color on anything.
another 'older' issue: it seems to me that imgui messes up the modifier info for gideros, e.g. application:getKeyboardModifiers() gets a false value for ALT being pressed easily (i'm just pressing/releasing alt e.g. while opening a popup and then ALT stays to be shown as pressed while in fact i've released it already - and then it keeps this false value until i press ALT again). i did not test if this issue is related to imgui but my guess is that it is as in the past i did not encounter this issue.
@rrraptor there is something strange with scaledimage, it renders over the child it should be in, see attached image (where an image overlaps with the button which has a house icon on it).
all in all there are 3 natural ways to use the bgcolor: 1. just image 2. image+rest of button area 3. image+rest of button area+padding i can imagine that scaledimagebutton gets too complicated after a while but it would nevertheless be nice to be able to choose between these 3 options. option 2 is what happens now i guess, option 3 can be achieved using some additional styling in my padded version but there is no way to do option 1, or am i wrong?
Do not use bgcolor = just image (set alpha to 0)? Button bg can be removed using "pushStyleColor".
another 'older' issue: it seems to me that imgui messes up the modifier info for gideros, e.g. application:getKeyboardModifiers() gets a false value for ALT being pressed easily (i'm just pressing/releasing alt e.g. while opening a popup and then ALT stays to be shown as pressed while in fact i've released it already - and then it keeps this false value until i press ALT again). i did not test if this issue is related to imgui but my guess is that it is as in the past i did not encounter this issue.
one more question related to the same. with my dirty padded button it looks as if 1,1 padding and fitHeight gave bigger padding on the top than on the bottom. see attached image.
Its hard to see on JPG Can u upload image in PNG?) On Windows 10: WIN+SHIFT+S -> select region -> CRTL+V in comment form
one more question related to the same. with my dirty padded button it looks as if 1,1 padding and fitHeight gave bigger padding on the top than on the bottom. see attached image.
Its hard to see on JPG Can u upload image in PNG?) On Windows 10: WIN+SHIFT+S -> select region -> CRTL+V in comment form
here is a png. it has 0,0 padding and stretched fitting. yet you can see that there is a small grey line above it without the image. i also attach the original texture so that you see that it does not have transparent area.
about the background color of the button i'm not sure what you mean by " Do not use bgcolor = just image (set alpha to 0)? Button bg can be removed using "pushStyleColor". " if you mean that i can set the color already in the png then i'd prefer to leave it transparent so that the bg color can be set by code. here is an image to explain the 3 options (in a letterbox setting): 1. image 2. image+button 3. image+button+padding
here is a png. it has 0,0 padding and stretched fitting. yet you can see that there is a small grey line above it without the image. i also attach the original texture so that you see that it does not have transparent area.
about the background color of the button i'm not sure what you mean by " Do not use bgcolor = just image (set alpha to 0)? Button bg can be removed using "pushStyleColor". " if you mean that i can set the color already in the png then i'd prefer to leave it transparent so that the bg color can be set by code. here is an image to explain the 3 options (in a letterbox setting): 1. image 2. image+button 3. image+button+padding
my image is something with transparent background, so i need to have white tint for the image itself. and then i'd need another color for the background of this 'white' image.
about padding issues, strange, i will double check my setup and if all fails i shall pm you, thanks.
@rrraptor there is something strange with scaledimage, it renders over the child it should be in, see attached image (where an image overlaps with the button which has a house icon on it).
Btw, you can use "scaledImageButtonWithText" instead of "scaledImage" + "button"
@rrraptor , the latest dll seriously messed up something with textures....
EDIT: please reup the old one quickly as now i'm stuck, i cannot go back to gideros-version due to different syntax of functions while this latest version is also impossible to use.
i had earlier the issue that i wanted the value updated realtime using some slider but i did not want it to be updated realtime while ctrl+click edited with keyboard, only after the value is submitted. finally i've come up with a solution, i thought i will share it:
myTempValue=imgui:sliderInt("",myTempValue,1, 100)if imgui:isItemActive()andnot pauseUpdate then myValue=myTempValue endif imgui:isItemDeactivatedAfterEdit()then pauseUpdate=false myValue=myTempValue endif imgui:isItemActivated()thenlocal _ctrl_pressed=(application:getKeyboardModifiers()&4==4)if _ctrl_pressed then pauseUpdate=trueendend
btw i'm still surprised that while for me this would be the intuitive behaviour, it is such a hassle to achieve it.
i'm trying to use these input text callbacks to achieve that the text should be aligned to the right instead of left. it is again too complicated to my taste but the only solution i came up with is to truncate the beginning of the text whenever we are not editing it. for this to work i need to change the value of the input text exactly when it is activated. how can i do that? e.g. i thought this would work but it is not:
self.currentDirTruncated, flag = imgui:inputText("###Path", self.currentDirTruncated, 256, ImGui.InputTextFlags_EnterReturnsTrue)if imgui:isItemActivated()then self.currentDirTruncated=lfs.currentdir()end
EDIT: i guess in the imgui source code it would be quite simple to add this feature though.
Comments
You can also set anchor point.
Added "scale mode", and a flag to always keep original image size.
Likes: keszegh, MoKaLux
Likes: SinisterSoft
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Likes: keszegh, SinisterSoft
Likes: MoKaLux, keszegh, SinisterSoft
Likes: keszegh
https://deluxepixel.com
Likes: keszegh
Its better to use it with image size = area size * scale and "stretch" scale mode.
Likes: MoKaLux, vitalitymobile, SinisterSoft
https://deluxepixel.com
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
EDIT:i see that you intend to do this with "ImGui:pushStyleVar(ImGui.StyleVar_FramePadding, x, y)" so i shall make my own function which wraps these together so that i do not need to make my code much longer.
here is my quick and dirty extension:
Fragmenter - animated loop machine and IKONOMIKON - the memory game
the issue is even more apparent with 0,0 padding as there is a line at the top but nothing at the bottom.
another problem with this solution to resize inner image using padding is that the 'boundary' does not get the bg color of the image.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
1. just image
2. image+rest of button area
3. image+rest of button area+padding
i can imagine that scaledimagebutton gets too complicated after a while but it would nevertheless be nice to be able to choose between these 3 options. option 2 is what happens now i guess, option 3 can be achieved using some additional styling in my padded version but there is no way to do option 1, or am i wrong?
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
i did not test if this issue is related to imgui but my guess is that it is as in the past i did not encounter this issue.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
On Windows 10: WIN+SHIFT+S -> select region -> CRTL+V in comment form
here is a png. it has 0,0 padding and stretched fitting. yet you can see that there is a small grey line above it without the image. i also attach the original texture so that you see that it does not have transparent area.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
" Do not use bgcolor = just image (set alpha to 0)? Button bg can be removed using "pushStyleColor". "
if you mean that i can set the color already in the png then i'd prefer to leave it transparent so that the bg color can be set by code.
here is an image to explain the 3 options (in a letterbox setting):
1. image
2. image+button
3. image+button+padding
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
scaledImageButton
scaledImageButtonWithText
about padding issues, strange, i will double check my setup and if all fails i shall pm you, thanks.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Likes: keszegh, SinisterSoft
dll updated.
Likes: SinisterSoft
EDIT: please reup the old one quickly as now i'm stuck, i cannot go back to gideros-version due to different syntax of functions while this latest version is also impossible to use.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Likes: MoKaLux
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
e.g. i thought this would work but it is not:
Fragmenter - animated loop machine and IKONOMIKON - the memory game