Template:Superimpose: Difference between revisions
From Horizon Wiki Mirror
Content deleted Content added
imported>Edwardcd Fixed code to make superimpose work. reduced number of variables to make adding easier. |
imported>Edwardcd m updated formatting, added more to example, cleaned up others stuff. |
||
| Line 33: | Line 33: | ||
* `x`: The horizontal position of the float image relative to the top-left corner of the base image (optional, defaults to 0). |
* `x`: The horizontal position of the float image relative to the top-left corner of the base image (optional, defaults to 0). |
||
* `y`: The vertical position of the float image relative to the top-left corner of the base image (optional, defaults to 0). |
* `y`: The vertical position of the float image relative to the top-left corner of the base image (optional, defaults to 0). |
||
* `align`: The alignment of the entire superimposed image block (optional, defaults to center). Choose from "left," "right," or "center." |
|||
| ⚫ | |||
* `float_link`: The optional link for the '''float image''' (e.g., " {{changes}} "). |
|||
* `base_alt`: The optional alternative text for the base image (used for accessibility). |
|||
* `float_alt`: The optional alternative text for the float image (used for accessibility). |
|||
* `base_caption`: The optional caption for the base image. |
|||
* `float_caption`: The optional caption for the float image. |
|||
===Examples=== |
===Examples=== |
||
{|border="1" |
{|border="1" |
||
|- BGCOLOR="e3e3e3" |
|- BGCOLOR="e3e3e3" |
||
! Code !! Result |
! Code !! Images || Result |
||
|- |
|- |
||
|<pre style="white-space:pre-line"> |
|<pre style="white-space:pre-line"> |
||
| Line 56: | Line 52: | ||
}} |
}} |
||
</pre> |
</pre> |
||
| <div style = "padding: 0px 30px 0px 10px;"> |
|||
| |
|||
| ⚫ | |||
* '''float image''' {{changes}} </div> |
|||
| <div style = "padding: 0px 60px 0px 30px;"> |
|||
{{Superimpose |
{{Superimpose |
||
| base = Icon_background.png |
| base = Icon_background.png |
||
| Line 64: | Line 63: | ||
| x = 4 |
| x = 4 |
||
| y = 4 |
| y = 4 |
||
}} |
}} </div> |
||
</noinclude> |
</noinclude> |
||
__NOTOC__ |
__NOTOC__ |
||
Revision as of 21:22, 17 March 2024
Superimpose Template
The "Superimpose" template allows you to overlay an image (called "float") on top of another image (called "base") using absolute positioning. Primary use is to display an image (like a weapon graphic) over it's background border.
Usage
To use the "Superimpose" template, follow this syntax:
{{Superimpose
| base = Base_image.png
| base_width = width_of_base_image (i.e. 32px)
| float = Float_image.png
| float_width = width_of_float_image (i.e. 28px)
| x = horizontal_position (optional, defaults to 0)
| y = vertical_position (optional, defaults to 0)
}}
Parameters
- `base`: The filename or file path of the base image that you want to display.
- `base_width`: The width of the base image in pixels (e.g., "200px").
- `float`: The filename or file path of the image that you want to float on top of the base image.
- `float_width`: The width of the float image in pixels (e.g., "100px").
- `x`: The horizontal position of the float image relative to the top-left corner of the base image (optional, defaults to 0).
- `y`: The vertical position of the float image relative to the top-left corner of the base image (optional, defaults to 0).
Examples
| Code | Images | Result |
|---|---|---|
{{Superimpose
| base = Icon_background.png
| base_width = 32px
| float = Changes.png
| float_width = 26px
| x = 4
| y = 4
}}
|
|
|
