LWUIT black lines between components - java-me

I have next question regarding LWUIT:
I have container with child components. A black lines around the child components shown on the screen, how can I remove them?
I tried to install zero option to padding and margin, but it did'nt help.

Check the border style for that child component. And if you using border means set the border to null or create the empty border for that child component.
Note: Ask the question clearly. Because you said child component, But you didn't mention which component you are using as a child component.

Related

Can you hide a node when not directly above a parent in Godot?

So I have an instanced scene that is supposed to be the child of a colour rect in my tree. I want to randomly generate the nodes, but I also want parts of the view to be cut off if the texture no longer is above the main section. I know you can render nodes below their parents, but I don't know if stopping part of them from rendering is physically possible.
In this image I want the bottom circle to remain the same, but the top circle to not show anything above the dark purple box
This is the node tree in the editor
Is there any way to do this directly, or am I gonna have to use a viewport of some variety?
I believe what you want is to set rect_clip_content to true on the ColorRect (or whatever Control). Making invisible any part of its children outside of it.
From Godot's documentation:
bool rect_clip_content
Enables whether rendering of CanvasItem based children should be clipped to this control's rectangle. If true, parts of a child which would be visibly outside of this control's rectangle will not be rendered.
If what you want is the opposite, perhaps you can use z_index to have something render on top, occluding the parts you don't want visible.
There is also a trick you can use with lights (including 2D lights):
Make a light that matches the area you want things to be visible.
Set a custom material that will be transparent by default, but visible on the light pass. The simpler way to do this is to set the light_mode of the material to "Light Only". You could also do it with a custom shader instead.
Making something disappear with light, in 2D, is impossible. In 3D, you can use flags_use_shadow_to_opacity. That is how you make a shadow catcher.
But, there is one more trick: you can use a mask. This should give you full control of when to show or hide things. So, if none of the above solutions works for you, use a mask. I have an explanation in a different answer. See also: How to crop sprite in a non-rectangular form?.
Mighty Mochi Games recently (2022-03-30) made a compilation of the different approaches in video form: Mask Methods Collection - Godot 3.x - 2D
.

Reset background color for QTabWidget

I see that QTabWidget background color is lighter than container widget. How to set its background to same as container widget has? Or better make it transparent?
I have following code:
tabWidget->setPalette(palette());
tabWidget->setBackgroundRole(backgroundRole());
tabWidget->setStyle(style()); // Set parent widget style
QPalette pal = tabWidget->palette();
pal.setColor(QPalette::Base, palette().background().color());
tabWidget->setPalette(pal);
which worked for me with QTreeWidget, however does not work for QTabWidget. Why Qt makes it different?
Solved by setting autoFillBackground to true in UI. However tabs titles background still white - any way to solve?

Can't add child sprite on scaled object

Ok, guys, here's the deal.
aboutBackground = Sprite::create("fadeBack.png");
aboutBackground->setScale(winSize.width, winSize.height);
aboutBackground->setPosition(winSize.width*0.5, winSize.height*0.5);
this->addChild(aboutBackground);
Sprite *sprAboutPanel = Sprite::create("aboutPanel.png");
sprAboutPanel->setPosition(aboutBackground->getBoundingBox().size.width*0.5, aboutBackground->getBoundingBox().size.height*0.5);
aboutBackground->addChild(sprAboutPanel);
Before scaling aboutBackground sprite it works perfectly. But because aboutBackground is just a fading background, I decided to go with 1px picture and scale it to full screen. But right now sprAboutPanel doesn't appear on the screen. I really wonder why? Thx for your responses!
One trick you can use in this instance is to not add the about panel as a child of the background, but rather the scene instead. Scaling a parent makes for tricky positioning of children since positions are scaled. You would probably find that in your code if you set the position of aboutPanel to (0.5,0.5) it would probably work as expected.
I would instead change:
aboutBackground->addChild(sprAboutPanel);
to this:
this->addChild(sprAboutPanel);

android applying a background to the whole screen, containing more than 1 textview

I am developing an app with a home screen, that has 6 text views, arranged in some order.
Now, I want to apply an image as a background to them.
If I apply that image to the parent layout, it's not visible as it is covered by all child layouts/textviews.So, I have to apply that background individually to all the textviews, to make it visible.
But,this is not I want.
Is there a way to apply that image as a background to the parent layout in such a way, that it is visible over all the child layouts.
Means, I want to apply that image as a background such that a single image can cover all the screen and is visible over the textviews, not applying the image to all the individual texviews.
You can also take the question as, how to make the textviews transparent?
Actually, I figured out a way..
I can define a custom layout in a separate file in drawable folder.
There, I can define a selector in which I can define a shape for defining the
gradient(for background gradient
),
solid(for applying solid color)..like elements.
In the solid element, I can define the color attribute as
<solid android:color="#android:color/transparent" />
Then, I can apply this layout as a background to all the textviews.
OR, If you want no other effect rather than just applying the background, you can do this without creating the file.
To each TextView individually, apply the background as:
android:background="#android:color/transparent"
These both ways can solve the problem easily.

Round Rect Button behavior when using a flipview controller

Hia.
I am using some round rect buttons with own images for their states. Each time am displaying a different view for some stuff, the buttons become white and my images are fading in briefly later.
The problem occurs only with the UIModalTransitionStyleCrossDissolve animation.
The other 3, UIModalTransitionStyleCoverVertical, UIModalTransitionStyleFlipHorizontal and UIModalTransitionStylePartialCurl, don't show this effect.
The effect would be ok, ok if the starting color would be black. I didn't find any way to change that color in IB. Where does it come from? Any idea?
Tried to set the background over the inherited properties of UIImage, but he simply ignored it. Switching the Round rect button to a custom one solved it. Leaves the question what to do if I want a round rect. A black background image didn't help. He seems to use the background color to fade.

Resources