Augment
A Augment is a container that can be placed around the main window.
Parameters
The anchor point, which is a normalized point relative to the top-left corner of the WindowContainer. (0,0,0) refers to the top-left-back corner, and (1,1,1) refers to the bottom-right-front corner.
A normalized 2D point, representing a point relative to the Augment itself, which will be aligned with the anchor.
The absolute offset will be applied after anchor and alignment.
The rotation of the Augment relative to itself.
The viewpoints to follow. By default, it is empty, which means that the Augment will not follow any viewpoints. (Equivalent to only following Front)
The corner radius of the Augment.
Whether to enable the material background.
The content of the Augment.
Samples
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.width
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalWindowInfo
import androidx.compose.ui.unit.dp
import com.pico.spatial.ui.foundation.geometry.NormalizedPoint3D
import com.pico.spatial.ui.foundation.window.Augment
import com.pico.spatial.ui.foundation.window.AugmentContentAlignment
fun main() {
//sampleStart
// A floating title bar above the window
Augment(anchor = NormalizedPoint3D.TopFront, alignment = AugmentContentAlignment.BottomCenter) {
val containerWidth =
with(LocalDensity.current) { LocalWindowInfo.current.containerSize.width.toDp() }
Row(Modifier.width(containerWidth).height(64.dp)) {
// some buttons
}
}
//sampleEnd
}A Augment is a container that can be placed around the main window.
Parameters
The anchor point, which is a normalized point relative to the top-left corner of the WindowContainer. (0,0,0) refers to the top-left-back corner, and (1,1,1) refers to the bottom-right-front corner.
A normalized 2D point, representing a point relative to the Augment itself, which will be aligned with the anchor.
The absolute offset will be applied after anchor and alignment.
The rotation of the subwindow. the Rotation3D.pivot'z will be ignored
The viewpoints to follow.Default is ViewPoint.All.
The corner radius of the Augment.
Whether to enable the material background.
The content of the Augment.
Samples
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.width
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalWindowInfo
import androidx.compose.ui.unit.dp
import com.pico.spatial.ui.foundation.geometry.NormalizedPoint3D
import com.pico.spatial.ui.foundation.window.Augment
import com.pico.spatial.ui.foundation.window.AugmentContentAlignment
fun main() {
//sampleStart
// A floating title bar above the window
Augment(anchor = NormalizedPoint3D.TopFront, alignment = AugmentContentAlignment.BottomCenter) {
val containerWidth =
with(LocalDensity.current) { LocalWindowInfo.current.containerSize.width.toDp() }
Row(Modifier.width(containerWidth).height(64.dp)) {
// some buttons
}
}
//sampleEnd
}