-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
famfamfam sprites generation tool #692
Open
4project-co-il
wants to merge
3
commits into
samclarke:master
Choose a base branch
from
4project-co-il:famfam-icon-merge-tool
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/bash | ||
FILES=src/famfamfam/*.png | ||
OUT=famfamfam.less | ||
IMAGE=famfamfam.png | ||
|
||
rm $OUT | ||
rm $IMAGE | ||
|
||
echo -e '// Where to find the famfamfam icon images' >> $OUT | ||
echo -e '@famfamfam-image-location: "famfamfam.png";' >> $OUT | ||
echo -e '' >> $OUT | ||
echo -e 'div.sceditor-grip, .sceditor-button div {' >> $OUT | ||
echo -e ' background-image: url("@{famfamfam-image-location}");' >> $OUT | ||
echo -e ' background-repeat: no-repeat;' >> $OUT | ||
echo -e ' width: 16px;' >> $OUT | ||
echo -e ' height: 16px;' >> $OUT | ||
echo -e '}' >> $OUT | ||
|
||
Y=0 | ||
$INIMAGES | ||
|
||
for f in $FILES | ||
do | ||
FILENAME=`basename -s .png $f` | ||
|
||
# skip grip images, those are not 16x16 icond and will be added at the end | ||
if [ $FILENAME == "grip" ] || [ $FILENAME == "grip-rtl" ] | ||
then | ||
continue | ||
fi | ||
|
||
echo -e ".sceditor-button-$FILENAME div { background-position: 0px $Y""px; }" >> $OUT | ||
|
||
INIMAGES="$INIMAGES $f" | ||
let "Y-=16" | ||
done | ||
|
||
montage -mode concatenate -background none -tile 1x $INIMAGES $IMAGE | ||
montage -mode concatenate -background none -tile 1x $IMAGE src/famfamfam/grip.png src/famfamfam/grip-rtl.png $IMAGE | ||
|
||
echo -e "" >> $OUT | ||
echo -e "div.sceditor-grip {" >> $OUT | ||
echo -e " background-position: 0px $Y""px;" >> $OUT | ||
echo -e " width: 10px;" >> $OUT | ||
echo -e " height: 10px;" >> $OUT | ||
echo -e "}" >> $OUT | ||
let "Y-=10" | ||
echo -e ".rtl div.sceditor-grip { background-position: 0px $Y""px; }" >> $OUT | ||
|
File renamed without changes
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the script language into a platform-agnostic one. For the sake of this project's survival we must not limit image contributions to linux users (even if only through an emulator or whatnot).
Because, to build, SCE already requires
node.js
(javascript), I highly recommend you using that. It will allow us to, more easily, create a workflow including this process and without introducing a new language.imagemagick exists for all 3 major platforms so that is not an issue.
Take a look at this. It might help you getting started on the communications part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, but I will leave it to someone else.
As I intend to use that script for my next PR (facebook video) and other changes specific to my system that won't be pushed, I propose to change the order of the icons in the sprite image to be in alphanumeric order and not sporadic as it is now and change the url.png to link.png to have all the icons match the command names.
I can push those changes separately.
Since there is no tool at all to create the sprite image and it have to be done manually, I don't see a reason why not to use it until there will be a better solution proposed by someone else.
I don't intend to create the image manually for my next changes. Any merge in the image will not be possible without a tool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please activate to allow changes from maintainers

^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is allowed on my side...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.