Override background

Learn here how to create and use plugins.

Moderator: Plugin Moderators

User avatar
Lobby
Developer
Reactions:
Posts: 3679
Joined: 26 Oct 2008, 12:34
Plugins: Showcase Store
Version: Beta

Platform

Override background

#1

Post by Lobby »

Screenshot_20171130-204326.png
Hi, as proposed here it's now possible to change the color of the background. The background basically persists out of a tile frame that's drawn over and over again. Unfortunately it's a bit less simple, as there are some special cases due to elevated coast lines. As a result you have to provide 3 frames to override the background:
frames_explain.png
frames_explain.png (1.95 KiB) Viewed 4179 times
Frames b and c are used to draw the background above water at the edges. This is crucial as ocean is drawn everywhere and has to be overdrawn at the correct positions.

The the used original frames look like:
frames_orig.png
frames_orig.png (408 Bytes) Viewed 4179 times
This sample replaces the background with a black one:
frames.png
frames.png (381 Bytes) Viewed 4179 times
For your own background, just recolor this image :)

The code to override the background looks like:

Code: Select all

[
  {
    "override":true,
    "id":"$anim_blank00",
    "type":"animation",
    "frames":[
      {"bmp":"frames.png","w":32,"h":16,"handle y":8},
      {"bmp":"frames.png","x":32,"w":16,"h":16,"handle y":8},
      {"bmp":"frames.png","x":48,"w":16,"h":16,"handle x":-16,"handle y":8}
    ]
  }
]
As you might notice it is also responsible for setting the handles properly. I recommend to just reuse this code instead of writing it on your own.
Attachments
own_background.json
(307 Bytes) Downloaded 134 times
own_background.zip
(1.58 KiB) Downloaded 188 times
=^._.^= ∫

User avatar
mdk_813
Inhabitant of a Country
Reactions:
Posts: 857
Joined: 16 Dec 2016, 02:38
Location: Germany
Plugins: Showcase Store

Platform

Re: [383]Override background

#2

Post by mdk_813 »

@Lobby
Thank you! :thumbsup:
My Plugins: Link

Update Sep 12, 2020:
As I am not really active here anymore, I am not able to answer any PMs in time.
So, as long as you mention me in the plugin and the description, feel free to use or modify my plugins for your own creations.

User avatar
KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 2192
Joined: 07 Jul 2016, 22:50
Location: 'Merica
Plugins: Showcase Store
Version: Beta
Contact:

Platform

Plugin Creator

Re: [383]Override background

#3

Post by KINGTUT10101 »

Is it possible to have multiple frames for the background?

User avatar
Lobby
Developer
Reactions:
Posts: 3679
Joined: 26 Oct 2008, 12:34
Plugins: Showcase Store
Version: Beta

Platform

Re: [383]Override background

#4

Post by Lobby »

no
=^._.^= ∫

BruceWillis24
Villager
Reactions:
Posts: 21
Joined: 09 Aug 2015, 00:42
Location: Grand Rapids Michigan
Plugins: Showcase Store
Version: Beta

Re: [383]Override background

#5

Post by BruceWillis24 »

@Lobby I really like the brown background in the first image you posted in this topic. Could you post that as well?

Thank you in advance!

User avatar
CommanderABab
AB
Reactions:
Posts: 10597
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Platform

Plugin Creator

Re: [383]Override background

#6

Post by CommanderABab »

There it is!  :)
There it is! :)

User avatar
Bearbear76
Former Bearbear65
Reactions:
Posts: 5439
Joined: 10 Feb 2017, 14:53
Plugins: Showcase Store
Version: Beta

Platform

Plugin Creator

Re: [383]Override background

#7

Post by Bearbear76 »

You can change the background
In winter by using "frames winter":[{}],
Something i discovered yesterday
Just my opinion
I'm probably recompiling my kernel... :o

User avatar
Lobby
Developer
Reactions:
Posts: 3679
Joined: 26 Oct 2008, 12:34
Plugins: Showcase Store
Version: Beta

Platform

Re: [383]Override background

#8

Post by Lobby »

Yes, you can do that everywhere where you have to provide frames :)
=^._.^= ∫

User avatar
Bearbear76
Former Bearbear65
Reactions:
Posts: 5439
Joined: 10 Feb 2017, 14:53
Plugins: Showcase Store
Version: Beta

Platform

Plugin Creator

Re: [383]Override background

#9

Post by Bearbear76 »

IMG_20171226_085022.jpg
Just my opinion
I'm probably recompiling my kernel... :o

Tyteam
Settler
Reactions:
Posts: 1
Joined: 29 Jan 2021, 15:45

Re: Override background

#10

Post by Tyteam »

can someone help me i dont know how to do it i want to make it like the sea color

Post Reply Previous topicNext topic

Return to “Tutorials and Documentation”