示例#1
0
        public void Initialize()
        {
            _assetManager.LoadRegistry();
            _i18NManager.LoadLanguage(CultureInfo.CurrentCulture);

            _audioManager.Listener = _camera;

            // registering window event
            _window.Load   += OnLoad;
            _window.Closed += OnClosed;
            _window.Resize += OnResize;

            _window.KeyDown += OnKeyDown;
            _window.KeyUp   += OnKeyUp;

            _window.UpdateFrame += OnUpdateFrame;
            _window.RenderFrame += OnRenderFrame;

            // apply icon
            var iconIdentifier = Minecraft.CreateIdentifier("icons/icon_32x32.png");
            var icon           = _assetManager.Load <Bitmap>(iconIdentifier);
            var iconHandle     = icon.GetHicon();

            _window.Icon = Icon.FromHandle(iconHandle);
        }
示例#2
0
        private static Identifier CultureInfoToAssetPath(CultureInfo cultureInfo)
        {
            var parentCulture = cultureInfo.Parent;
            var langName      = cultureInfo.TwoLetterISOLanguageName + '_' + parentCulture.TwoLetterISOLanguageName;

            return(Minecraft.CreateIdentifier("lang/" + langName + ".json"));
        }