Skip to content

Commit

Permalink
Merge branch 'main' into olavra-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
olavra authored Oct 14, 2024
2 parents 0839302 + faaa3fe commit c751e0b
Show file tree
Hide file tree
Showing 11 changed files with 91 additions and 528 deletions.
5 changes: 0 additions & 5 deletions content/creator/places/_index.md

This file was deleted.

57 changes: 0 additions & 57 deletions content/creator/places/faq.md

This file was deleted.

55 changes: 54 additions & 1 deletion content/creator/sdk7/2d-ui/ui_button_events.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ It can also have:
- `font`: Font of the text on the button.
- `textAlign`: Alignment of the text inside the button
- `uiTransform`: Positioning properties of the UI element.
- `uiBackground`: Set the color or texture of the UI element.

The following example shows how to create a clickable UI button.

Expand All @@ -47,6 +48,8 @@ ReactEcsRenderer.setUiRenderer(() => (
You can also write the function that is executed by the click outside the UI definition, and reference it by name. This helps keep the UI code more readable, and is also useful if multiple clickable UI entities need to call the same function.

```ts
import { ReactEcsRenderer } from '@dcl/sdk/react-ecs'

function handleClick() {
// Do something onClick
console.log('Clicked on the UI')
Expand Down Expand Up @@ -98,7 +101,57 @@ ReactEcsRenderer.setUiRenderer(() => (
))
```

You're also free to use all of the properties on background freely. You can also set a variant and then override some of its properties.
You're also free to use all of the properties on background freely. You can also set a variant and then override some of its properties. This example uses the `primary` variant, but overrides the color to be green:

```ts
import { ReactEcsRenderer } from '@dcl/sdk/react-ecs'

ReactEcsRenderer.setUiRenderer(() => (
<Button
value="My Button!"
variant="primary"
uiTransform={{ width: 100, height: 100 }}
onMouseDown={() => {
console.log('Clicked on My Button!')
}}
uiBackground={{
color : Color4.Green()
}}
/>
))
```

## Togglable buttons

A common use case is to make a button toggle between two states, like a switch. The example below switches between two colors each time the button is pressed:

```ts
import { ReactEcsRenderer } from '@dcl/sdk/react-ecs'

let buttonEnabled = false

ReactEcsRenderer.setUiRenderer(() => (
<Button
value="My Button"
variant="primary"
uiTransform={{ width: 100, height: 100 }}
onMouseDown={() => {
console.log('Clicked on My Button!')
buttonEnabled = !buttonEnabled
if(buttonEnabled){
// do something
} else {
// do something else
}
}}
uiBackground={{
color : buttonEnabled ? Color4.Green() : Color4.Red()
}}
/>
))
```

Note that in the example above, the color depends on a `buttonEnabled` variable. Whenever this variable's value changes, it inmediately affects the background color.

## Making other elements clickable

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ For detailed instructions on how to submit your collections for approval before

There is a required fee for publishing items. This fee was originally [voted in place by the Decentraland DAO](https://governance.decentraland.org/proposal/?id=50092c00-c315-11eb-ac84-1705d1ae4a66) to deter users from publishing an excessive number of wearables in an attempt to "spam" the wearables market.

On Jun 24, 2022 [a proposal](https://governance.decentraland.org/proposal/?id=b8075360-e8e7-11ec-82d9-d917cdd158ac
) regarding publication fees has pegged them to a fixed amount of **150 USD per item, to be paid in Polygon MANA**.

**Update**: On Sep 02, 2023 [a proposal](https://governance.decentraland.org/proposal/?id=98d74360-3eae-11ee-88e6-1fe6cb69ee51) updated the publication fees to **100 USD per item, to be paid in Polygon MANA**.
On Sep 02, 2023 [a proposal](https://governance.decentraland.org/proposal/?id=98d74360-3eae-11ee-88e6-1fe6cb69ee51) set the publication fees to **100 USD per item, to be paid in Polygon MANA**.

{{< hint warning >}}
**📔 Note**: You can move MANA between Ethereum and Polygon using the [Account dApp](https://account.decentraland.org).
Expand Down
2 changes: 1 addition & 1 deletion content/creator/worlds/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Keep the following in mind:
- The scene has no parcel limitations (since January 2023)
- All Worlds are automatically listed on the Places page unless you opt out as detailed below

Some of the Worlds deployed to the Foundation's Worlds Content Server may be eligible for being listed in Decentraland Places. See [eligibility criteria]({{< ref "/content/creator/places/faq.md#worlds" >}}) for more details.
Some of the Worlds deployed to the Foundation's Worlds Content Server may be eligible for being listed in Decentraland Places.

If you wish to opt-out from your Worlds being indexed in Places, you can add the following section in your `scene.json`:

Expand Down
Loading

0 comments on commit c751e0b

Please sign in to comment.