Open Quillraven opened 1 week ago
If an image without a drawable can exist and might make sense for some use cases, it should be possible to create with the DSL. This might be an oversight, but it can be easily amended without breaking the API. Drawable?
with a null
default could be a way to solve this, I just have to check first if an image without a drawable isn't otherwise broken (e.g., thowing NPE on draw). Thanks for bringing this up.
Imo this should be just fine and at least in my case it works. Here is also the official documentation of setDrawable
which mentions it may be null:
Hi,
right now the
image
scene2d extension requires a non-nullDrawable
:However, it is valid to pass "null" as a drawable and this can be useful if the real drawable is set later on but you still want to add the image to the table to have the correct layout.
Would it be okay to make it
Drawable?
instead ofDrawable
? This might be also true for other extensions with drawables but I did not check them all.Or is there a different solution to it?