# Prof. Monster's Frame

**URL:** <https://blenderartists.org/t/prof-monsters-frame/498387>\
**Category:** Game Engine Resources\
**Created:** [February 1, 2011, 4:02am UTC](https://blenderartists.org/t/prof-monsters-frame/498387 "2011-02-01T04:02:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Monster](https://blenderartists.org/user_avatar/blenderartists.org/monster/32/2958_2.png) [@Monster](https://blenderartists.org/u/Monster)\
**Post date:** [February 1, 2011, 4:02am UTC](https://blenderartists.org/t/prof-monsters-frame/498387/1 "2011-02-01T04:02:48Z")

</div>

Hi,

A new group is ready: **FRAME**

 ![](https://blenderartists.org/uploads/default/original/3X/d/1/d16be746ab99b10f1fff105a2062341828c5afe1.PNG)  
  
With that you can easily create resizable frames in your game. You can apply different styles. Even custom styles are no problem. And they are 3D as expected.

# What is it good for?

I thought about using it for dialog boxes etc., but it can be anything.

# How to install it?

- Download the file [Frame.blend](https://blenderartists.org/uploads/default/original/3X/5/b/5bba134dc97f89dc68329593046e41cc0203f463.blend) (61.7 KB)
- Link shift+F1 the group _Frame_
- Add an instance of _Frame_ to your scene
- Add to the instance:
  - property **Frame**
  - property **width** - with the initial width (float in BU)
  - property **height** - with the initial height (float in BU)

# How to resize in-game?

Add following logic to the Frame instance:

- property sensor True pulse, “changed” prop: **width** 
- property sensor True pulse, “changed” prop: **height**
- both connected to Python controller _Module_: **LinkLib.copyPropsToBase**

**How to change the frames style?**  
 Make sure you have the new style available in your scene (e.g. at an inactive layer).

- Download the file [FrameStyles.blend](https://blenderartists.org/uploads/default/original/3X/0/3/03506faae35f42a594c9a74f62f61074d35ab8ce.blend) (45.1 KB)
- Link a style group or group **AllStyles**
- create an instance of the group on an hidden layer
- switch back to the frame instance and
- add a property **style** as string with the name of the style (currently: Hard, RoundThin, Simple, Borderless)
- the default style is **Default**

## in-game

- property sensor True pulse, “changed” prop: **style**
- connected to Python controller _Module_: **LinkLib.copyPropsToBase**

[Frame.blend](https://blenderartists.org/uploads/default/original/3X/5/b/5bba134dc97f89dc68329593046e41cc0203f463.blend) (61.7 KB)  
[FrameStyles.blend](https://blenderartists.org/uploads/default/original/3X/0/3/03506faae35f42a594c9a74f62f61074d35ab8ce.blend) (45.1 KB)

I hope you find it usefull  
Monster

---

<div class="post-metadata">

**Author:** ![Monster](https://blenderartists.org/user_avatar/blenderartists.org/monster/32/2958_2.png) [@Monster](https://blenderartists.org/u/Monster)\
**Post date:** [February 1, 2011, 4:03am UTC](https://blenderartists.org/t/prof-monsters-frame/498387/2 "2011-02-01T04:03:08Z")

</div>

**How to create customized styles?**

Styles are meshes. That means they need game objects to be assigned to. The names of the game objects do not matter, but the names of the meshes are important.  
Attention: Only the display meshes are changed when changing the style.

The name of a style mesh consists of \<prefix\>.\<suffix\>

- prefix = style name (e.g. Simple)
- suffix = the part of the frame

**Frame parts**  
 ![](https://blenderartists.org/uploads/default/original/3X/7/2/72a8e52b22d2bc5a33e414b873a75cdb7f882b0a.png)  
  
The suffix simply tells where the part should be:

- M = middle
- T = top
- B = Bottom
- L = left
- R = right

A combination of two letters means it is a corner.  
You do not need to create all parts for a style. If a mesh can’t be found the mesh of another mesh is used.  
So you can create a style with just one mesh (e.g. Simple).  
The order how to copy the meshes is as follow:  
M -\>T  
T -\> B,LT,L  
L -\> R  
LT -\> RT,LB  
LB -\> RB

**How to create customized style meshes?**  
 ![](https://blenderartists.org/uploads/default/original/3X/f/c/fc9c9b71191c207516d8110f4097e2bf22943798.PNG)  
  
There are some rules:

- The center of the mesh is always right below  
[LIST]

- regardless where the part should be placed

- the part will be rotated automatically to fit the frame

- The X and Y size of the middle (.M) is always 1.0

- The X size of an edge (.T,.B,.R,.L) is always 1.0

- All other dimensons doesn’t matter, but determine to overall size of the frame and its border  
[/LIST]

---

<div class="post-metadata">

**Author:** ![torakunsama](https://blenderartists.org/user_avatar/blenderartists.org/torakunsama/32/1313869_2.png) [@torakunsama](https://blenderartists.org/u/torakunsama)\
**Post date:** [February 1, 2011, 8:29am UTC](https://blenderartists.org/t/prof-monsters-frame/498387/3 "2011-02-01T08:29:13Z")

</div>

Now that’s useful, I’ll see if I can use it!  
Thanks for this great resource Monster Sensei, you came through once again!

---

<div class="post-metadata">

**Author:** ![AdobeBatista](https://blenderartists.org/letter_avatar_proxy/v4/letter/a/b5e925/32.png) [@AdobeBatista](https://blenderartists.org/u/AdobeBatista)\
**Post date:** [February 21, 2011, 7:48am UTC](https://blenderartists.org/t/prof-monsters-frame/498387/4 "2011-02-21T07:48:27Z")

</div>

That is cool
