I am using cocos2d-x and cocosbuilder 3.0 alpha2. It is very convenient to use auto scaled sprites in cocosbuilder. You can add png files under resources-auto directory and content will be automatically scalled during publishing. You don't have to scale images programmatically.
I would like to use CCLabelBMFont for old and new iPhone. I was trying to use the same method for fnt files. I saved fnt files under resources-auto directory. Then I opened these resources by cocosbuilder and it crashed ;/
Where should I save these fnt files ? Should I create two version of fnt files (regular and retina) ? How to use CCLabelBMFonts for many display resolutions ?
First, I would strongly recommend updating to the latest version of CocosBuilder as it fixes some issues with the automatic resizing of assets.
CocosBuilder can only automatically resize image resources. To add support for different sized fonts you will need to place them (save different sizes from your font creation tool) in folders called resources-iphone, resources-iphonehd, resources-ipad or resources-ipadhd.
Related
I originally transferred this project from windows to linux, and it was working completely fine on windows, but now images are not loading.
I have an image:
<img src="/assets/s1.png" alt="dinosaur">
And it is only loading on the webpage if I change the filepath to /home/user/Desktop/Project/assets/s1.png
The image file is in the folder assets and the assets folder and html file are both within the Project folder.
The weird thing is that when I change /home/user/Desktop/Project/assets/s1.png to /Desktop/Project/assets/s1.png it stops working. I would like to be able to only include the necessary path /assets/s1.png because I will need the path to stay the same if this project gets moved around between environments.
Based on a comment on the question:
the address of the page is file:///home/user/Desktop/Project/file.tpl
That's the problem then. The "root" of the "web server" (from the browser's perspective) is the root of the file system. So this absolute path won't work:
<img src="/assets/s1.png" alt="dinosaur">
But this one will:
<img src="/home/user/Desktop/Project/assets/s1.png" alt="dinosaur">
However, that latter one clearly won't be helpful in a web-hosted environment.
You can instead use a relative path, for example:
<img src="./assets/s1.png" alt="dinosaur">
This should work in the example given, but we can't know if this will have further implications in a larger and more complex web application. For example, if you're dynamically loading sections or templates from different folders, their "relative paths" may be different. (That's one advantage of absolute paths, they're the same regardless of what page you're on.)
But more to the root cause of the problem... You really shouldn't be testing a web page from the file system. The intent is to host it on a web server, so the testing should be hosted on a web server.
It makes little sense to make changes to the code in order to get it to work in an environment that will never be used, only to probably have to make more changes to get it to work in the actual target environment. Keep the test environment and the target environment as similar as possible.
We have a wiki that was brought back from the dead using a torrent image archive of 32gb+ (that's compressed).
We ran importImages. That created sub-directories, probably from the image paths of the wiki articles.
Well, we have a lot of images not loading correctly (white space).
Turns out the importImages did not move all the images into their correct subdirecotires.
When you look up the image, it will have the expected sub directory i.e. images/1/1a/hello.jpg
But, the actual file is still in images/hello.jpg.
If you try to reupload the image using the single file uploader, it gives you an overwrite warning, ignoring this warning corrects the image, and stores it in the right subdirectory. But we have 200k+ images, and you cannot overwrite images using uploadWizard.
Is there a way to fix this? A parameter we can run, or a way to set all image paths to use just .../images/?
We are using version 1.35.1
Perhaps, $wgHashedUploadDirectory or $wgLocalFileRepo is not set correctly on LocalSettings.php. If this is not the case, try to launch importImages.php with --overwrite option.
Hi i am making my own website. And make alot of copies, do some changes. to see what version I like best. But this takes up space on the HD. And I have a small ssd.
Is it possible to put a shortcut to my images folder in all my versions? So all my versions only contain the html files.
I have all my image files stored in a sub folder to the html files.
you can create a new "website" only containing images, you can even call it images. And then in all your website versions you will access images via general url like http://localhost/images/
I have a small problem that concerns an outsourced website development company who will not (for perfectly normal and valid reason) allow us access to the server to alter stylesheets. I've been tasked to redesign a website layout. Problem is, I cannot access the website nor a dev environment to alter the stylesheets to bring forth these ideas. Only route to this would be to create a local custom.css to send via email to the person who uploads them. However, I cannot in good faith just throw them a CSS file to be applied on a live site without fully cross-browser checking it and I cannot do this locally on IE, Safari or Opera.
One solution was to save the website locally as HTML (file, save as...) but the problem is the background CMS is complete crap, meaning it has like 200 completely unnescessary CSS files and it is organized as:
main.css has 7 #import rules with relative paths.
Inside this is another stylesheet with 16 #import rules with relative paths.
Inside this... You get the picture.
This would mean I would have to shift through these 200 import rules and files to download them manually via the address bar. So my question is:
How can I save this website as HTML to my computer to apply a custom user stylesheet file to it so I can cross-browser test it properly? Is there some website that can go through a site and compress all the CSS to one file or smth?
You can download a whole website with dependencies using programs like HTTrack
http://www.httrack.com/
It allows you to download a World Wide Web site from the Internet to a local directory, building recursively all directories, getting HTML, images, and other files from the server to your computer. HTTrack arranges the original site's relative link-structure. Simply open a page of the "mirrored" website in your browser, and you can browse the site from link to link, as if you were viewing it online. HTTrack can also update an existing mirrored site, and resume interrupted downloads. HTTrack is fully configurable, and has an integrated help system.
WinHTTrack is the Windows 2000/XP/Vista/Seven release of HTTrack, and WebHTTrack the Linux/Unix/BSD release.
It doesn't consolidate all the CSS files into one, but it is better to retain the files as-is if you want to minimize changes
Is it possible to load .ttf font from bytecode without using [embed] metatag or compiling font into .swf?
Situation next: My app gets zip archive with graphics, and I want to add chance to change visualization font.
But I can't use swf-compilation in that case. Instruments: FlexSDK, FLashDevelop.
The only way to use runtime loaded ttf/otf fonts is do the same that mxmlc do: transcode font files to AS3 classes, construct the new swf, load it into Loader and get fonts classes (that is embed ttf file into newly crated swf in runtime). You have to check the swf spec and I guess the Flex SDK 4.6 sources will be helpful. May be you will be able to find implementation, I can't managed to do this.
The still is the simple way - precompile each font file to swf and include it to your graphics zip, I don't this it's too hard even for non developer profession to click the bat file (you can make the template with as file and place the sdk and build bat file, all that artist need it's place the font file with the given name near the bat file, you event can ask in bat for the name of font and replace it in the template) :)
Actually this isn't an answer, but I don't have enough reputation yet to add a comment.
I see the question is over a year old. Did the situation happen to change since then? For a VJ application I'm working on it would be nice if the users could just drop a TTF file in the resources directory to use it, rather than me having to make SWFs of all fonts that could be interesting to use - which would be way too time consuming anyway and will pose licensing issues I'd like to avoid.