简体   繁体   中英

How use ShapeRenderer along with ScrollPane in LibGDX?

Am currently making a game in LibGDX for Android. So far I have a ScrollPane with a table inside that contains a list with custom rows [AS SHOWN IN THE ATTACHED IMAGE]. I want each of those rows surrounded by a rectangle. Is it possible to achieve this?

These are the rows of the list

在此输入图像描述

Since this has been viewed 100 times I might as well contribute even though it's almost 3 years old.

You can set debug on the child widget attached to the Scrollpane (which is probably a Table, so debugAll() or whatever you wish), which outlines the boundaries of the actors automatically.

This internally uses a Shaperenderer to do it from the Stage, and you can change the colour through the Table.debugTableColor, Table.debugCellColor, and Table.debugActorColor static fields.

Table.debugTableColor is for outlining the entire table, Table.debugCellColor is for each of the table's cells, and Table.debugActorColor is for the actors contained within each of the cells.

But yeah, this should only be used for debugging the layout.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM