Tuesday, July 08, 2014

Mac Print Screen的方法


直接在桌面存個 png檔
1) Command + Shift + 3. Capture Whole Screen
2) Command + Shift + 4. Capture Part of Screen
3) Command + Shift + 4 and press Space Bar. Capture Objects (Icon, Dock, Menu, Submenu, etc)

擷取在剪貼簿裡
1) Command + Shift + Control + 3.  Capture Whole Screen
2) Command + Shift + Control + 4.  Capture Part of Screen
3) Command + Shift + Control + 4 and press Space Bar.  Capture Objects

PS: 2018年Mac Mojava (10.14)  的出現多了一個新方法
3) Command + Shift + 5 叫出 screen capture tool

Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file:

Today, I try to run the desktop project of Libgdx on Mac OS X 10.9. I ran the simple project on Android Studio, and the error below:

Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: badlogic.jpg
at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:140)
at com.badlogic.gdx.graphics.glutils.FileTextureData.prepare(FileTextureData.java:64)
at com.badlogic.gdx.graphics.Texture.load(Texture.java:130)
at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:121)
at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:100)
at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:92)
at com.diesel.bugs.DieselBugs.create(DieselBugs.java:21)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:136)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:114)


Caused by: com.badlogic.gdx.utils.GdxRuntimeException: File not found: badlogic.jpg (Local)
at com.badlogic.gdx.files.FileHandle.read(FileHandle.java:134)
at com.badlogic.gdx.files.FileHandle.readBytes(FileHandle.java:218)
at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:137)ddd


After googling a while i found this found thie libgdx wifi:


The application will fail the first time. Open the Run Configuration you just created and set the working directory to the android/assets/ directory!
link your desktop project to android assets folder?
Go to Run => Run Configurations.. => choose DesktopLauncher, Arguments Tab => Working Directory => Others then browse to yourproject-android/assets/ and click Apply => Run


This is for Eclipse, but im using Android Studio now, so ?!?!?! ok, Im going to make my own tutorial here:

1) Select "Edit Configurations....."
2) Edit the working directory and change it to the directory of the android's assets

Done !!!!