# GameClubButton wx.createGameClubButton(Object object)
Start from base library version 2.0.3. Please remaining backward compatible.
Creates a game club button. The user will be directed to the game club of the Mini Game after tapping this button. For more information, see the user guide to Game Club.
# Parameters
# Object object
Attribute | Type | Default | Required | Description |
---|---|---|---|---|
type | string | Yes | The button type | |
text | string | No | The text on the button. It is valid only when type is text . | |
image | string | No | The background image of the button. It is valid only when type is image . | |
style | Object | Yes | The button style | |
icon | string | Yes | The icon of the game club button, which is valid only when the object.type parameter is set to image. |
Valid values of type
Value | Description | Minimum Version |
---|---|---|
text | A button that can be configured with background color and text | |
image | A button that can only be configured with background image. The background image is stretched to fit the button. |
style is composed as follows
Attribute | Type | Default | Required | Description |
---|---|---|---|---|
left | number | Yes | The x-coordinate of the top-left corner | |
top | number | Yes | The y-coordinate of the top-left corner | |
width | number | Yes | Width | |
height | number | Yes | Height | |
backgroundColor | string | Yes | Background color | |
borderColor | string | Yes | The color of the border | |
borderWidth | number | Yes | The width of the border | |
borderRadius | number | Yes | The radius of the rounded corner on the border | |
textAlign | string | Yes | Text alignment method | |
fontSize | number | Yes | Font size | |
lineHeight | number | Yes | The line height of the text |
Valid values of style.textAlign
Value | Description | Minimum Version |
---|---|---|
left | Left | |
center | Center | |
right | Right |
Valid values of object.icon
Value | Description | Minimum Version |
---|---|---|
green | Green icon | |
white | White icon | |
dark | White icon with black rounded background | |
light | Green icon with white rounded background |
# Return Values
# GameClubButton
# Sample Code
let button = wx.createGameClubButton({
icon: 'green',
style: {
left: 10,
top: 76,
width: 40,
height: 40
}
})