Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
texturetown [2024/09/16 00:23] – GlitchyZorua | texturetown [2025/02/21 17:43] (current) – GlitchyZorua | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== TextureTown ====== | ====== TextureTown ====== | ||
- | **TextureTown** or **TT** is a Texture Repository. It can be found in the " | ||
- | When you first visit TextureTown, | ||
- | {{ : | ||
+ | **TextureTown** or **TT** is a Texture Repository. It can be found in the " | ||
- | {{ :tt_badge.gif? | + | When you first visit TextureTown, |
+ | {{ : | ||
+ | |||
+ | {{ : | ||
===== Interaction ===== | ===== Interaction ===== | ||
+ | |||
There is 17 categories in TT. Here is a list of them: | There is 17 categories in TT. Here is a list of them: | ||
- | - Abstract Brown & Grey | + | * Abstract Brown & Grey |
+ | * Abstract Green & Yellow | ||
+ | * Abstract Pink & Blue | ||
+ | * Building Parts | ||
+ | * Fabric | ||
+ | * Fire & Light | ||
+ | * Fractals | ||
+ | * Humans & Technology | ||
+ | * Leather & Fur | ||
+ | * Metal | ||
+ | * Nature & Earth | ||
+ | * Paper & Sponge | ||
+ | * Pattern & Prints | ||
+ | * Plants | ||
+ | * Stone & Brick | ||
+ | * Water | ||
+ | * Wood | ||
- | - Abstract Green & Yellow | + | Hovering over the texture will show you a nice preview of the hovered texture. It previews it as a tiled background, Sphere, Cube and a flat square! {{ : |
- | - Abstract Pink & Blue | + | When the user wants to download the selected texture, they can simply click on the texture, and it'll be downloaded. |
- | - Building Parts | + | TextureTown has a Texture of the day, which picks a random texture every day! |
- | - Fabric | + | TextureTown also has a Mastodon Instance, allowing users to see the texture of the day.[([[https:// |
- | - Fire & Light | + | ===== Playground ===== |
- | - Fractals | + | The background on the main page of TextureTown is a 3D render of the TextureTown' |
- | - Humans & Technology | + | We will be met with [[Ozwomp]], and [[Nombeg]], in greyscale. |
- | - Leather | + | {{: |
- | - Metal | + | We can look around by dragging the mouse, and to move, you hold the right click button. |
- | - Nature & Earth | + | If we drag and dropped a file onto the playroom, we can see that the specific object gets applied with the picture we dropped on to. |
- | - Paper & Sponge | + | {{: |
- | - Pattern & Prints | + | Additionally, |
- | - Plants | + | | Object | Message | Character? |
+ | | Cushion | That cushion is bigger than your house... could you carry it? | No | | ||
+ | | Flat Box | Looks like its a boxed copy of Ozwomps Voyage :O | No | | ||
+ | | Latter | Woah thats a big ladder! Its much too big for you to go up!! | No | | ||
+ | | Ozwomp | Ozwomp: Play my game HUMAN! Visit the Games Page : ^ Yes ^ | ||
+ | | Nombeg | Nombeg #7: Life is suffering... maybe this will help Visit the Games Page : ^ Yes ^ | ||
- | - Stone & Brick | + | ===== API ===== |
- | - Water | + | TextureTown has it's own API. |
- | - Wood | + | All textures are listed in the manifest in JSON format: [[https:// |
- | Hovering over the texture | + | * info - contains useful meta data - such as the manifest version and texture |
+ | * catalogue - contains | ||
- | When the user wants to download the selected | + | To construct a texture |
- | TextureTown has a Texture of the day thing, which picks a random texture each day! | + | You can also access thumbnails in the same fashion - select from the thumbnail folder - prefix the filename with **" |
- | TextureTown also has a Mastodon Instance, allowing users to see the texture of the day.[(https:// | + | To find a specific file or category by name, I suggest using a map (e.g. in Javascript **catalogue.map(x => x[name]);**) |
+ | Finally you can access a pretty formatted section name using **catalogue[INDEX OF THE CATEGORY YOU WANT].niceName** - e.g. **" | ||
- | ===== Playground ====== | + | Here is a simple random fire texture script to use on your site! |
- | The background on the main page of TextureTown | + | |
- | We will be met with [[Ozwomp]], and [[Nombeg]], in greyscale. | + | <code js sample.js> |
+ | //Download the Manifest File | ||
+ | fetch(" | ||
+ | .then((res) => res.json()) | ||
+ | .then((json) => { | ||
+ | //Success! Your code goes here! | ||
+ | let manifest = json; | ||
+ | |||
+ | //Get the index of the fire category | ||
+ | let fireIndex = manifest.catalogue | ||
+ | .map(function (e) { | ||
+ | return e.name; | ||
+ | }) | ||
+ | .indexOf(" | ||
- | {{: | + | //Pick a random image from that category |
+ | let fireCatagoryFileCount = manifest.catalogue[fireIndex].files.length; | ||
+ | let randomImageName = manifest.catalogue[fireIndex].files[ | ||
+ | Math.floor(Math.random() * fireCatagoryFileCount) + 1]; | ||
- | We can move the camera by dragging the mouse. | + | //Create a full texture url |
+ | let textureURL = manifest.info.base_url + "/" | ||
+ | + manifest.info.textures_folder + "/" | ||
+ | + "/" | ||
- | If we drag and dropped a file onto the playroom, we can see that the specific object gets applied with the picture we dropped. | + | alert(textureURL); |
+ | }); | ||
+ | |||
+ | </ | ||
- | {{: | ||