저는 모노 게임에 콘텐츠 파이프 라인이 있다고 생각하지만, 맥에서 작동하는지 잘 모르겠습니다. 언뜻 보면 Visual Studio에서만 작동합니다.
하지만 특정 유형의 파일을 Monogame에서 직접로드 할 수 있다는 것을 알고 있습니다. 각 플랫폼에서 콘텐츠 파이프 라인을 통과시키지 않고도 텍스처 및 오디오 용 파일 유형을 하나 이상 추가 할 수 있습니다. 내 주요 게임 개발 플랫폼이 모노 게임이긴하지만 실제 콘텐츠 파이프 라인이 있는지 여부를 모르겠다는 큰 이유는 내가 사용하지 않고 직접 텍스처와 오디오를로드한다는 것입니다.
글꼴 파일은 콘텐츠 파이프 라인을 통과해야합니다. XNA에서 컴파일 된 글꼴 .xnb 파일이 있습니다. 몇 년 동안 프로젝트간에 던져 버렸습니다.
지금까지 Windows 용으로 만 개발 한 적이 있지만 Windows에서는 파이프 라인을 거치지 않고 직접로드 할 수있는 두 가지 파일 유형이 텍스처 용 PNG와 오디오 용 .WAV입니다. 어떤 제품이 Mac 용인지 확신 할 수 없습니다. 아마도 지원되는 제품이 실제로 파이프 라인을 구현했을 때 사라져 버렸기 때문입니다.
마지막으로 PNG 파일이 Mac에서 작동하지 않는다면 (다른 파일 유형 중 하나 일 것입니다.) 여기에 System.Drawing 비트 맵을 texture2D로 변환하려고 작성한 클래스가 있습니다. 동적 텍스처 작업.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System.Drawing;
namespace DevSoc_Game.Wrappers
{
public static class BitmapToTexture2d
{
static GraphicsDevice graphicsDevice;
public static void Init (GraphicsDevice device)
{
graphicsDevice = device;
}
/// <summary>
/// Converts a bitmap to a texture2D.
/// </summary>
/// <param name="bitmap"></param>
/// <returns></returns>
public static Texture2D BitmapToTexture2D (Bitmap bitmap)
{
//each pixel has four colour bytes, so multiply the array.
int bufferSize = bitmap.Width * bitmap.Height * 4;
System.IO.MemoryStream memStream = new System.IO.MemoryStream(bufferSize);
bitmap.Save(memStream, System.Drawing.Imaging.ImageFormat.Png);
Texture2D texture = Texture2D.FromStream(graphicsDevice, memStream);
/* Texture2D texture = new Texture2D(graphicsDevice, bitmap.Width, bitmap.Height);
for (int xdx = 0; xdx < bitmap.Width; xdx++)
{
for (int ydx = 0; ydx < bitmap.Height; ydx++)
{
System.Drawing.Color colour = bitmap.GetPixel(xdx, ydx);
}
}
*/
memStream.Close();
return texture;
}
}
}
아, 내가이 글을 쓰는 완료 온 것처럼, 나는 (내가 처음 발견 가능한 사이트) monogame 기본적으로로드 할 수있는 파일 형식을 가진 사이트를 찾을 수 있습니다. Here, partway down
외모에 따르면, 당신은 소리가 나지 않는데, 맥을 쓰는 것입니다.
손잡이는 무엇을 의미합니까? – craftworkgames