Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tremus/figmaboundsheader
Figma plugin for generating a c friendly Bounds.h file with the dimensions of all selected nodes
https://github.com/tremus/figmaboundsheader
c cpp figma figma-plugin gui
Last synced: 15 days ago
JSON representation
Figma plugin for generating a c friendly Bounds.h file with the dimensions of all selected nodes
- Host: GitHub
- URL: https://github.com/tremus/figmaboundsheader
- Owner: Tremus
- Created: 2023-04-24T07:02:01.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2025-01-09T10:54:32.000Z (26 days ago)
- Last Synced: 2025-01-09T11:42:23.427Z (25 days ago)
- Topics: c, cpp, figma, figma-plugin, gui
- Language: TypeScript
- Homepage:
- Size: 6.84 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FigmaBoundsHeader
A plugin for [Figma](https://www.figma.com/).
Scans the dimensions of each selected node and writes all the x/y/width/height info in a big `C` friendly `.h` file
If you use [juce](https://github.com/juce-framework/JUCE) you may be interested the original [repo](https://github.com/Tremus/CSS2JUCE)
Example:
```C
#pragma once
extern const float fbh_Navbar[4];
extern const float fbh_Navbar__Meter[4];
extern const float fbh_Navbar__Meter__Vector80[4];
#ifdef FIGMABOUNDSHEADER_IMPL
const float fbh_Navbar[4] = {0, 0, 875, 44};
const float fbh_Navbar__Meter[4] = {552, 8, 112, 30};
const float fbh_Navbar__Meter__Vector80[4] = {635, 33, 12, 5};
#endif // FIGMABOUNDSHEADER_IMPL
```In the above example I had selected a _group_ named **Navbar**. This group had a child node named **Meter** which is also a group. Meter had a child node named **Vector80** which is a custom shape that I drew.
The double underscore (`"__"`) indicates the z-index of the node.
Spaces and special characters in the names of your nodes simply get erased.
No checking is done for duplicate names of nodes, so be careful how you name them.
If you wish to skip a node, prefix the name of the node with an underscore eg. rename `Vector80` to `_Vector80` will skip adding the info to our header.