Hey everyone,
First, i am using Twine version 2.0.11 and SugarCube version 2.11.0 (at least thats what appears when i check inside Twine)
On my game, i am trying to create a character sheet for the player.
This needs to be populated by stuff like
Agility: Average
Strength: Good
Stamina : Below Average
Karma: Good
The first thing that came into my mind was to present a different image photoshopped for each situation based on the variables. One for Average, Average, Average, Average... another for Good, Average, Average, Average... you know what i mean.
This creates a lot of images that need to be stored in the game.
Is there a way for twine to put two images together, one in front, another in the background, in order to have always 1 background, and in front you would have the specific Good, Average, Below Average images?
The other way would be to separate the main image in several blocks, one with the stats, the other with the main image, and then have twine "glue" them together, if possible.
I know this is not an easy request for help, my thanks in advance.
Cheers,
Magma
Comments
Then in your css:
If you want specific positioning, you'll have to mess around with the css of the images. Without knowing the sizes of the images in question and how they're all meant to fit together, it's hard to provide specifics.
I will come back for assistance once i know the size and disposition of the images.
Thank you.
So, here is the major part of the character sheet.
As you can i see i would like to have the name dynamic and the values.
I suppose the best way would be to have all the names as "images" that would be put over the current base one?
Let me know your thoughts and thank you in advance for your help.
Quick Edit: I realize that it looks a bit too big on my screen, so i might have to scale it down. Anyway the coding should be similar and i can tinker and trial and error alot
Cheers,
Magma
1. The overall background, excluding the Character Face image and attribute sections.
2. The Character Face image. This could be displays as a background image, using CSS classes to control which image is currently being shown.
3. The Attributes list, which I would used standard HTML elements to output.
I would then use CSS to layout and style the different sections, and I would probably place point 2 and 3 within SugarCube's StoryCaption special passage.
eg. The HTML in StoryCaption would look something like the following: note: The above code was written free-hand and has not been tested.
Dividing the one big picture into blocks. 5 Blocks so far...
So... now i have these two blocks, top and bottom:
The question is how can i make sure these appear "glued" together, also knowing i will have more images to the right that will also need to be "glued" together.
Example:
- Needs to be on the right
- Needs to be even more to the right
All these image blocks need to be exchangable, so i can exchange based on in-game variables. As does the text that goes inside.
This should be the final result:
Btw, i know this sounds silly, and that you guys offer your advices and all because you are awesome, but if any of you wants to "step up" and make this happen, i don't mind giving something in return for this, either steam keys, amazon stuff, whatever you feel is a token of gratitude on my part. Hope that is not against the rules...
Back to the drawing board. Thanks.
I mean, your artist should be able to send you the background and the other components of the image. It's just probably best to combine everything into a layout using CSS from the start.
There very well may be a way to do this with the image chopped up; I'm not a web designer. But I that even a web designer would have trouble doing it like that.
I did a bit of Photoshop to remove the white background from the charlayer and portraitlayer. Then i searched the web for examples and found this css3 example:
1.jpg became my background image
2.png became my charlayer
3.png became my portraitlayer
And i got all 3 images working together.
Questions...
Can i apply this code directly on twine?
Will i be able to replace 2.pgn with 2a.pgn based on a variable?
I still have to put 4.pgn and 5.pgn as the text boxes, will i be able to have twine right variable texts inside the boxes?
Thank you in advance for all the help.
Cheers,
Magma
Because you want to totally replace SugarCube's standard UI with one of your own I suggest you read about and play around with its new StoryInterface special passage. You could uses something like the following as a starting point:
Next I would suggest using the setPageElement() function to associate custom passages within your story with the new left-ui-bar and right-ui-bar HTML elements so that their output will automatically be inserted into those element each time a Passage is shown. You could use a postrender Task Object to do that association, this would be done within your story's Story Javascript area.
The StoryLeftSidebar passage would contain the content to display the character image and stats, the following is based on my suggestion in a previous comment.
For the StoryRightSidebar passage I am not 100% sure what the right sidebar is doing, not what ID's to give its elements so I will used CSS classes to distinguish the first section from the second but I suggest you replace those classes with actual ID's.
The following CSS is a starting point for positioning and styling the new HTML elements, and is heavily based on SugarCube's, you will need to play around with it to suit the visual output you are looking for. The CSS goes in your story's Story Stylesheet area. NOTE: I did not include background-image attributes in the above CSS but I suggest the over-all background should be assigned to the #story selector, and the character face background to the #character-face selector.
While it's mentioned in the link given by greyelf, I'll reiterate it here just so we're clear. The StoryInterface special passage was added in SugarCube v2.18.0. I bring this up only because the original poster mentioned they were using SugarCube v2.11.0. Meaning they'll have to install v2.18.0 if they want the feature—I'd do it simply for the bug fixes, let alone the raft of other added features and improvements.
Additionally. A bit more information about StoryInterface can be found in the New Sugarcube release : StoryInterface special passage thread.
I will let you know as soon as got some improvements.
I can use one of the already existing side bar menus to display the character sheet. Then the player can just click return to go back to the main story.
Not that i wouldn't like to use the whole screen but for now at least i will just display the image when the player asks for it in the left side menu.
Now, this above still works when i copy paste directly into twine and presents the several image overaly as one picture only. So, now i need it to replace 2.png with 2a.pgn based on a variable from twine, same for 3.pgn, etc... i might be using a lot of layers.
Something like IF $hair="black" then 3.png=3black.png, else 3.png=3brown.pgn
Not that actual code, but you understand where i am trying to get.